previous |
start |
next
Frame Windows
- Application program, not applet
- Construct and show frame
JFrame frame = new JFrame();
. . .
frame.show();
- Set the default close operation
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
- Add components to a panel, then set the panel as content
pane
JPanel panel = new JPanel();
panel.add(. . .);
panel.add(. . .)
frame.setContentPane(panel);
previous |
start |
next