<<< The Swing Class Hierarchy | Index | Complete Swing Example >>> |
Application windows inherit from JFrame class.
Applets inherit from JApplet class.
The JFrame.getContentPane( ) method returns the container where program can
add visible components
modify the layout.
For example,
JButton button = new JButton( "Hello" ); frame.getContentPane().add( button ); // add button to layout
For complete example see A1/application/SwingMain.java ( download ) sample program.
<<< The Swing Class Hierarchy | Index | Complete Swing Example >>> |