Z
zhanggok
Unregistered / Unconfirmed
GUEST, unregistred user!
import javax.swing.*;
public class Buttons extends JFrame {
JButton abort = new JButton("Abort");
JButton retry = new JButton("Retry");
JButton fail = new JButton("Fail");
public Buttons() {
super("Buttons");
setSize(190, 140);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
retry.setSize(90,50);
JPanel pane = new JPanel();
pane.add(abort);
pane.add(retry);
pane.add(fail);
setContentPane(pane);
//show();
//abort.setVisible(false);
//setVisible(true);
}
public static void main(String[] arguments) {
Buttons rb = new Buttons();
rb.show();
}
}
retry.setSize(90,50);为什么没有改变retry的大小.
public class Buttons extends JFrame {
JButton abort = new JButton("Abort");
JButton retry = new JButton("Retry");
JButton fail = new JButton("Fail");
public Buttons() {
super("Buttons");
setSize(190, 140);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
retry.setSize(90,50);
JPanel pane = new JPanel();
pane.add(abort);
pane.add(retry);
pane.add(fail);
setContentPane(pane);
//show();
//abort.setVisible(false);
//setVisible(true);
}
public static void main(String[] arguments) {
Buttons rb = new Buttons();
rb.show();
}
}
retry.setSize(90,50);为什么没有改变retry的大小.