import javax.swing.JFrame; import java.util.Scanner; /** * Canvas. * * @author John Paxton * @version October 14, 2008 */ public class Canvas { public static void main (String [] args) { JFrame frame = new JFrame(); DrawEllipses picture; Scanner in = new Scanner (System.in); int width; int height; int howMany; System.out.println("CS 160, Lab 6, October 14, 2008 - Circle Drawer"); System.out.println("-----------------------------------------------\n"); System.out.print("Enter the screen width in pixels: "); width = in.nextInt(); System.out.print("Enter the screen height in pixels: "); height = in.nextInt(); System.out.print("Enter the number of ellipses to draw: "); howMany = in.nextInt(); frame.setSize(width, height); frame.setTitle("Nested Ellipses"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); picture = new DrawEllipses (howMany); frame.add(picture); frame.setVisible(true); } }