import javax.swing.JFrame; /** A viewer class to see a picture I drew with * just three simple Java graphics objects, namely * Rectangle, Line2D.Double, Ellipse2D.Double * * @author P. Conrad, based on code from Cay Horstman, Big Java, 3rd edition * @version for CS10, S09, UCSB, 04/29/2009 */ public class PhillsPictureViewer { public static void main(String[] args) { JFrame frame = new JFrame(); // Set the size to whatever size you like (width, height) // For projects you turn in, lets not get any bigger than 640,480 frame.setSize(640,480); // @@@ MODIFY THIS LINE IF YOU LIKE // Set your own title frame.setTitle("Phill's Drawing"); // @@@ MODIFY THIS LINE // Always do this so that the red X (or red circle) works // to close the window. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Instantiate your drawing as a "component" // @@@ MODIFY THE NEXT LINE PhillsPictureComponent component = new PhillsPictureComponent(); // Always add your component to the frame // and then make the window visible frame.add(component); frame.setVisible(true); } }