import java.awt.*;
import javax.swing.*;
public class Crisis extends JFrame {
JButton panicButton = new JButton("Panic");
JButton dontPanicButton = new JButton("Don't Panic");
JButton blameButton = new JButton("Blame Others");
JButton mediaButton = new JButton("Notify the Media");
JButton saveButton = new JButton("Save Yourself");
public Crisis() {
super("Crisis");
setSize(300, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GridLayout jj = new GridLayout(2, 3);
setLayout(jj);
add(panicButton);
add(dontPanicButton);
add(blameButton);
add(mediaButton);
add(SaveButton);
}
public static void main(String[] args) {
Crisis ll = new Crisis();
}
}
通过了编译,怎么无法运行啊 |
|