Target.java
1    
2    
3    package npw;
4    
5    import java.awt.Color;
6    import javax.swing.SwingUtilities;
7    import painter.SPainter;
8    import shapes.SCircle;
9    
10   public class Target {
11       //THE SOLUTION TO THE TARGET PROBLEM
12   
13       private void paintTheImage() {
14           SPainter klee = new SPainter("Target",600,600);
15           SCircle dot = new SCircle (200);
16           klee.setColor(Color.RED);
17           klee.paint(dot);
18   
19           //drawing the white dot
20           dot.setRadius(133); klee.setColor(Color.WHITE); klee.paint(dot);
21   
22           //drawing smaller red dot
23           dot.setRadius(66); klee.setColor(Color.RED); klee.paint(dot);
24   
25       }
26   
27   
28   
29       // REQUIRED INFRASTRUCTURE
30   
31       public Target() {
32   
33           paintTheImage();
34       }
35   
36       public static void main(String[] args) {
37           SwingUtilities.invokeLater(new Runnable() {
38               public void run() {
39                   new Target();
40               }
41           });
42       }
43   }
44   
45   
46   
47   
48   
49