Target.java
1    /* 
2     * Program to paint the Target symbol instead of the Blue Dot 
3     * in the context of a Nonrepresentational Painting World, NPW 
4     */
5    
6    package npw;
7    
8    import painter.SPainter;
9    import shapes.SCircle;
10   import javax.swing.SwingUtilities;
11   import java.awt.Color;
12   
13   public class Target {
14   
15       // THE SOLUTION TO THE BLUE DOT PROBLEM
16       private void paintTheImage() {
17           SPainter klee = new SPainter("Target", 600, 600);
18           SCircle target = new SCircle(200);
19           SCircle white = new SCircle(150);
20           SCircle middle = new SCircle(75);
21           klee.setColor(Color.RED);
22           klee.paint(target);
23           klee.setColor(Color.white);
24           klee.paint(white);
25           klee.setColor(Color.RED);
26           klee.paint(middle);
27       }
28       // REQUIRED INFRASTRUCTURE
29   
30       public Target() {
31           paintTheImage();
32       }
33       public static void main(String[] args) {
34           SwingUtilities.invokeLater(new Runnable() {
35               @Override
36               public void run() {
37                   new Target();
38               }
39           });
40       }
41   }
42