每当我尝试编译和运行此代码时:
import java.awt.GridLayout;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
public abstract class screen implements ActionListener {
private JFrame title = new JFrame("Tic-Tac-Toe");
private JButton play = new JButton("");
private JButton quit = new JButton("");
public screen() {
/* Create Window */
title.setSize(300,300);
title.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
title.setLayout(new GridLayout(3,3));
/* Add Buttons To The Window */
title.add(play);
title.add(quit);
/* Action Listeners */
play.addActionListener(this);
quit.addActionListener(this);
/* Make The Window Visible */
title.setVisible(true);
/* Letters */
play.setText("PLAY");
quit.setText("QUIT");
}
}
我明白了:
线程“main”中的异常 java.lang.NoSuchMethodError: main
我不知道我做错了什么。
我是新手。
请帮忙!!!