<<< Font class | Index | >>> |
Common practice: define a class that descends from JFrame class
Advantages: configure JFrame properties and controls in object's constructor
Note: remember to call parent class constructor using the super keyword
public class JMyFrame extends JFrame { static final int WINDOW_WIDTH = 210; static final int WINDOW_HEIGHT = 130; //constructor public JMyFrame() { super( "window title goes here" ); setSize( WINDOW_WIDTH, WINDOW_HEIGHT ); setDefaultCloseOperation( javax.swing.WindowConstants.EXIT_ON_CLOSE ); setVisible( true ); } }//class JMyFrame
<<< Font class | Index | >>> |