我如何在IntelliJ的Java Swing(JGoodies)中使用FormLayout

问题描述 投票:0回答:1

我真的很失望,当我在“ 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

java swing layout-manager jgoodies form-layout
1个回答
1
投票

确定2天后最终确认,我必须下载jgoodies-common-x.x.x.jar和jgoodies-forms-x.x.x.jar并将其添加到库中

© www.soinside.com 2019 - 2024. All rights reserved.