Target.java
1    package npw;
2    
3    import java.awt.Color;
4    import javax.swing.SwingUtilities;
5    import painter.SPainter;
6    import shapes.SCircle;
7    
8    public class Target {
9    
10       /* 
11           Program that draws a target 
12        * 
13        */
14   
15       //The solution to the blue dot problem
16   
17       private void paintTheImage() {
18   
19           SPainter klee = new SPainter("Target", 600, 600);
20           klee.setColor(Color.RED);
21           SCircle dot1 = new SCircle(225);
22           klee.paint(dot1);
23           SCircle dot2 = new SCircle(150);
24           klee.setColor(Color.WHITE);
25           klee.paint(dot2);
26           SCircle dot = new SCircle(75);
27           klee.setColor(Color.RED);
28           klee.paint(dot);
29       }
30   
31       //Required infrastructure
32   
33       public Target() {
34   
35           paintTheImage();
36   
37       }
38   
39       public static void main(String[] args) {
40   
41           SwingUtilities.invokeLater(new Runnable() {
42               @Override
43               public void run() {
44                   new Target();
45               }
46           });
47   
48       }
49   
50   
51   }
52