/home/cdesrivi/NetBeansProjects/CS1/src/npw/Target.java |
1
2
3
4
5 package npw;
6
7 import java.awt.Color;
8 import javax.swing.SwingUtilities;
9 import painter.SPainter;
10 import shapes.SCircle;
11
12
13
14 @author
15
16 public class Target {
17
18
19 private void paintTheImage() {
20 SPainter klee = new SPainter("Target", 600, 600);
21 SCircle dot1 = new SCircle(200);
22 klee.setColor(Color.RED);
23 klee.paint(dot1);
24 SCircle dot2 = new SCircle(150);
25 klee.setColor(Color.WHITE);
26 klee.paint(dot2);
27 SCircle dot3 = new SCircle(100);
28 klee.setColor(Color.RED);
29 klee.paint(dot3);
30 }
31
32
33 public Target() {
34 paintTheImage();
35 }
36
37 public static void main(String[] args) {
38 SwingUtilities.invokeLater(new Runnable() {
39 public void run() {
40 new Target();
41 }
42 });
43 }
44
45 }
46