Target - GOval oval = new GOval(x-0.65*radius,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * File: * Name: * Section Leader: * ----------------- * This file is the starter file for the Target problem. */ import*; import acm.program.*; import java.awt.*; i public class Target extends GraphicsProgram { p public void run() { p int x=getWidth()/2; int y=100; int radius=72; GOval outeroval = new GOval(x-radius, y-radius, 2*radius, 2*radius); outeroval.setFillColor(Color.RED); outeroval.setFilled(true); outeroval.setColor(Color.WHITE);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: GOval oval = new GOval(x-0.65*radius, y-0.65*radius, 2*0.65*radius, 2*0.65*radius); oval.setFillColor(Color.WHITE); oval.setFilled(true); oval.setColor(Color.WHITE); GOval inneroval = new GOval(x-0.3*radius, y-0.3*radius, 2*0.3*radius, 2*0.3*radius); inneroval.setFillColor(Color.RED); inneroval.setFilled(true); inneroval.setColor(Color.WHITE); add(outeroval); add(oval); add(inneroval); } }...
View Full Document

This note was uploaded on 10/25/2010 for the course CS 106A at Stanford.

Ask a homework question - tutors are online