package mis.hw2;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JFrame;
@SuppressWarnings("serial")
public class P2_BullsEye extends JFrame
{
//Declare Variables
int centerX, centerY, outermostRadius, ringWidth;
// Constructor
public P2_BullsEye ()
{
super ("BullsEye");
//Assign Variables
}
public void paint (Graphics g)
{
//Call the paint method of the JFrame
super.paint (g);
centerX = 150;
centerY = 150;
outermostRadius = 100;
ringWidth = 22;
//Make color blue
g.setColor(Color.blue);
//Draw blue Oval
g.drawOval(125, 140, 20, 20);
g.drawOval(90, 110, 90, 80);
g.drawOval(50, 80, 170, 140);
//Fill blue Oval you just drew
g.fillOval(125,140, 20, 20);
g.fillOval(90, 110, 90, 80);
g.fillOval(50, 80, 170, 140);
//Make color pink
g.setColor(Color.pink);
//Draw pink Oval
g.drawOval(70, 95, 130, 110);
//Fill pink Oval you just drew
g.fillOval(110, 125, 50, 50);
g.fillOval(70, 95, 130, 110);
}
public static void main(String args []) {
// Create app object
P04_BullsEye app = new P04_BullsEye();
app.setSize(300, 300);
app.setVisible(true);
app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}