/** * CircleWindow shows how to create a simple subclass * of JFrame. When you instantiate a CircleWindow object * (as is done in main, for example), it initializes its * own size and position and then makes itself visible. * When the window's contents need to be drawn, the Java * Virtual Machine calls the CircleWindow object's paint * method. * * @author Jeff Ondich, 1/12/04 */ import java.awt.*; import javax.swing.*; public class CircleWindow extends JFrame { public static void main( String[] args ) { CircleWindow cw = new CircleWindow(); } public CircleWindow() { setSize( 1000, 300 ); setLocation( 50, 50 ); setVisible( true ); } public void paint( Graphics g ) { g.setColor( Color.green ); g.fillOval( 100, 10, 100, 100 ); } }