谁能画出如下程序的运行结果?
import java.awt.*;
import javax.swing.*;
public class Demo {
public static void main(String[] args) {
JFrame frame = new JFrame("Demo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container pane = frame.getContentPane();
pane.setLayout(new GridLayout(0,3));
pane.add(new JButton("Button 4"));
pane.add(new JButton("Button 3"));
pane.add(new JButton("Button 2"));
pane.add(new JButton("Button 1"));
frame.pack();
frame.setVisible(true);
}
} |
|