我正在制作一个类似于Banko小程序的Java应用程序。当我点击“public void init()”方法时,我就很顺利。当我完成时,除了那个以外,编译的所有东西。它告诉我添加@Override注释。我试过了,但每当我做什么,无论我把它的,编译器失败,出现以下错误:@Override注释问题
找不到符号
符号:类覆盖
位置:类aBomb.Bomb
我不知道什么可能会阻止应用程序正常执行。 :| 如果您在我下面写的代码中发现了您认为应该更改的内容,请告诉我。我是比较新的的Java :( 代码:
public void init() {
BorderLayout border = new BorderLayout();
setLayout(border);
JPanel top = new JPanel();
JLabel moneyLabel = new JLabel("Money : $");
moneyField = new JTextField("", 8);
moneyField.setEditable(false);
JLabel foundLabel = new JLabel("Found: ");
foundField = new JTextField("", 8);
foundField.setEditable(false);
restart = new JButton("Restart");
restart.addActionListener(this);
top.add(moneyLabel);
top.add(moneyField);
top.add(foundLabel);
top.add(foundField);
top.add(restart);
add(top, BorderLayout.NORTH);
board = new Board(this, ROW_COUNT, COLUMN_COUNT, BOMB_COUNT);
add(board, BorderLayout.CENTER);
setup();
setVisible(true);
}
这是什么类? – zsalzbank 2010-12-16 01:19:03
你在哪里尝试添加注释? – 2010-12-16 01:22:54
@Anon我试图在public void init之前放置@Override并且在它下面 – fireshadow52 2010-12-16 01:25:33