现在框架内添加两个按钮 但是好像有错误 代码如下(开发环境eclipse):
public class c {
public static void main(String[] args) {
JButton btn2 = new JButton("重新答题");
JButton btn1 = new JButton("提交");
JFrame f1 = new JFrame("Choose");
f1.setBounds(100,100,500,600);
f1.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f1.add(btn1);
f1.add(btn2);
btn1.setBounds(100,45,300, 450);
btn2.setBounds(100,45,100, 450);
f1.setVisible(true);
}
}

public class c {
public static void main(String[] args) {
JButton btn2 = new JButton("重新答题");
JButton btn1 = new JButton("提交");
JFrame f1 = new JFrame("Choose");
f1.setBounds(100,100,500,600);
f1.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f1.add(btn1);
f1.add(btn2);
btn1.setBounds(100,45,300, 450);
btn2.setBounds(100,45,100, 450);
f1.setVisible(true);
}
}
