类Gui_Started是public,应该在名为Gui_Started.java的文件中声明公共类Gui_Started扩展JFrame {

时间:2017-07-11 14:26:48

标签: java user-interface

我尝试使用记事本制作项目并使用cmd进行调试,我收到了class Gui_Started is public, should be declared in a file named Gui_Started.java public class Gui_Started extends JFrame{的错误

import javax.swing.JFrame;

public class Gui_Started extends JFrame{
    public static void main(String[] args) {

        Gui_Started gui = new Gui_Started();
        gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        gui.setSize(500,500);
        gui.setVisible(true);
        gui.setTitle("Gui Pertama");

    }
}

0 个答案:

没有答案