我有一个对话框需要显示,但是它出现了编译错误。编译错误在最后一部分中给出。
import javax.swing.*;
class SwingDemo {
SwingDemo() {
JFrame jfrm = new JFrame("A Simple Swing Application");
jfrm.setSize(275, 100);
jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel jlab = new JLabel(" Swing means powerful GUIs.");
jfrm.add(jlab);
jfrm.setVisible(true);
}
public static void main(String args[]) {
public void run() {
new SwingDemo();
}
}
}
错误信息如下:
Multiple markers at this line
- Syntax error on token "void", @ expected
- Syntax error, insert "enum Identifier" to complete EnumHeaderName
- Syntax error, insert "EnumBody" to complete BlockStatements