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