本文介绍了Eclipse中的WindowBuilder设计选项卡不完整的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为项目创建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 Designer,所有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文件相关联"在Window>首选项> 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 时,这是已知问题:

Eclipse错误572210-使用CGLIB进行反射式访问会破坏Java 16及更高版本中的windowbuilder

作为解决方法(请参见评论3 ),在 eclipse.ini 中将以下行添加到末尾(或至少在 -vmargs ):

As a workaround (see comment 3), in eclipse.ini add the following line to the end (or at least after -vmargs):

--illegal-access=permit

这篇关于Eclipse中的WindowBuilder设计选项卡不完整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 06:13