有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

JAVA:从主类调用GUI类

因此,基本上,我想在主类中调用GUI类,但没有成功

package javaui;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;


public class JavaUI {

    /**
     * @param args the command line arguments
     */

    public static void main(String[] args) {
        // TODO code application logic here
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                RegistrationForm gui = new RegistrationForm();
                JFrame frame = new JFrame();
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.getContentPane().add(gui);
                frame.pack();
                frame.setVisible(true);
            }
        });

    }

}

我已经做了一个类,但我未能加载。 enter image description here

我希望在启动程序时自动调用GUI


共 (1) 个答案

  1. # 1 楼答案

    移动注册表单后重试。java包javaui下的类文件