Source of Shapes2.java


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