我真的很失望,当我在"IntelliJ“中使用Swing Java时,它运行起来没有任何问题,但是当我使用JGoodies…时FormLayout它不能与我一起运行,并显示以下错误:
Exception in thread "main" java.lang.NoClassDefFoundError: com/jgoodies/forms/layout/FormLayout
代码如下:
import javax.swing.*;
import java.awt.*;
public class Adddata extends JFrame {
private JPanel mainpanlll;
public Adddata(String title ) {
super(title);
try {
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setContentPane(mainpanlll);;
this.pack();
} catch (Exception e )
{
e.getMessage();
}
}
public static void main(String[] args) {
try {
JFrame frame = new Adddata("HI");
frame.setVisible(true);
} catch (Exception e )
{
e.getMessage();
}
}
}
这是错误信息,enter image description here
发布于 2020-04-28 07:27:16
好的,经过2天的搜索,我终于发现我必须下载jgoodies common-x.jar和jgoodies forms-x.jar并将其添加到库中
https://stackoverflow.com/questions/61473394
复制相似问题