在构造函数Java中调用Overridable方法

时间:2015-11-29 19:55:44

标签: java swing netbeans constructor method-overriding

我有这段代码:

//

public class LaunchScreen extends JFrame implements ActionListener { private final JMenu commandMenu = new JMenu("Commands"); private final JMenuItem add = new JMenuItem("Add"); private final JMenuItem search = new JMenuItem("Search"); private final JMenuItem quit = new JMenuItem("Quit"); public LaunchScreen() { super(); setSize(300, 300); setTitle("Library Search"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); commandMenu.add(add); commandMenu.add(search); commandMenu.add(quit); } @Override public void actionPerformed(ActionEvent e) { } } 之后的三行有警告super();。这是什么意思?这个问题的其他答案对我没有帮助。

0 个答案:

没有答案