Target.java
1    /* 
2     * Program to paint a target in NPW. 
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   public class Target {
13   
14       //The solution to the Blue Dot problem.
15   
16       private void paintTheImage() {
17           SPainter klee = new SPainter("Target", 700, 700);
18           SCircle dot = new SCircle(300);
19           klee.setColor(Color.RED);
20           klee.paint(dot);
21           SCircle bot = new SCircle(200);
22           klee.setColor(Color.WHITE);
23           klee.paint(bot);
24           SCircle mot = new SCircle(100);
25           klee.setColor(Color.RED);
26           klee.paint(mot);
27       }
28   
29       public Target() {
30           paintTheImage();
31       }
32   
33       public static void main(String[] args) {
34           SwingUtilities.invokeLater(new Runnable() {
35               public void run() {
36                   new Target();
37               }
38           });
39       }
40   
41   }
42