问题描述
我正在为一个项目创建一个 JFrame,在尝试编辑它时,设计选项卡是空白的.
I was creating a JFrame for a project and while trying to edit it, the design tab was blank.
我已经创建了一个测试项目,所有内容都处于默认状态,并且这个错误"没有出现.还在那里.
I've created a test project with everything on default and this "error" still there.
测试代码如下:
package test;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
public class Test extends JFrame {
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Test frame = new Test();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public Test() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
}
}
这就是我已经完成的:
WindowBuilder 已经安装,包括 1.9.5 和 1.9.6.pre Nightly Build(我也试过只安装其中之一,但没有成功).
WindowBuilder is already installed, both 1.9.5 and 1.9.6.pre Nightly Build (i've tried installing only one of them too but no success).
我已经安装了 Swing 所需的所有软件包,包括:Swing 设计器、所有 SWT 组件和所有 WindowBuilder 组件.
I have installed all the necessary packages for Swing, including: Swing Designer, All SWT Components, and all WindowBuilder Components.
我已经尝试卸载并重新安装所有这些软件包和组件,但仍然没有成功.
I've tried to uninstall and install it again all of those packages and components, but still no success.
选项将 WindowBuilder 编辑器与自动识别的 Java GUI 文件相关联"on Window>Preferences>WindowBuilder 已经被选中.
The option "Associate WindowBuilder editor with automatically recognized Java GUI files" on Window>Preferences>WindowBuilder is already checked.
唯一剩下的就是重新安装 Eclipse,因为我安装了多少插件,我有点担心.重新安装它们会很痛苦(有点).
The only thing left would be reinstalling Eclipse which i'm kinda concerned with because of how many plugins i have installed. Reinstalling them would be a pain (kinda of).
WindowBuilder 是否与某些插件不兼容?我有一些适用于 Python 和其他只是 QoL 的.
Does WindowBuilder have some incompatibilities with some plugin? I have a few for Python and others that is just QoL.
问题已解决,对于任何人来说,只要在最后一行的 eclipse.ini 添加 --illegal-access=permit
即可.
Problem solved, for anynone going through that as well, just add --illegal-access=permit
in the eclipse.ini in the last line.
推荐答案
当使用 Java 16 或更高版本运行 Eclipse 时,这是一个已知并且已经修复的问题:
This is a known and already fixed issue when running Eclipse with Java 16 or higher:
WindowBuilder 问题 #45 - 使用 CGLIB 进行反射访问会破坏 Java 16 及更高版本中的 windowbuilder
更新:该问题已修复.它已在 WindowBuilder Nightly Build(更新站点:https://download.eclipse.org/windowbuilder/lastgoodbuild/
) 并将在即将发布的 WindowBuilder 1.9.8 版本中可用.
Update: The issue has been fixed. It is already available in the WindowBuilder Nightly Build (update site: https://download.eclipse.org/windowbuilder/lastgoodbuild/
) and will be available in the upcoming WindowBuilder 1.9.8 release.
这篇关于Eclipse 中的 WindowBuilder 设计选项卡不完整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!