public class LinesRectsOvals
1: // Fig. 12.19: LinesRectsOvals.java
2: // Drawing lines, rectangles and ovals.
3: import java.awt.Color;
4: import javax.swing.JFrame;
5:
6: public class LinesRectsOvals
7: {
8: // execute application
9: public static void main( String args[] )
10: {
11: // create frame for LinesRectsOvalsJPanel
12: JFrame frame =
13: new JFrame( "Drawing lines, rectangles and ovals" );
14: frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
15:
16: LinesRectsOvalsJPanel linesRectsOvalsJPanel =
17: new LinesRectsOvalsJPanel();
18: linesRectsOvalsJPanel.setBackground( Color.WHITE );
19: frame.add( linesRectsOvalsJPanel ); // add panel to frame
20: frame.setSize( 400, 210 ); // set frame size
21: frame.setVisible( true ); // display frame
22: } // end main
23: } // end class LinesRectsOvals
24:
25: /**************************************************************************
26: * (C) Copyright 1992-2005 by Deitel & Associates, Inc. and *
27: * Pearson Education, Inc. All Rights Reserved. *
28: * *
29: * DISCLAIMER: The authors and publisher of this book have used their *
30: * best efforts in preparing the book. These efforts include the *
31: * development, research, and testing of the theories and programs *
32: * to determine their effectiveness. The authors and publisher make *
33: * no warranty of any kind, expressed or implied, with regard to these *
34: * programs or to the documentation contained in these books. The authors *
35: * and publisher shall not be liable in any event for incidental or *
36: * consequential damages in connection with, or arising out of, the *
37: * furnishing, performance, or use of these programs. *
38: *************************************************************************/