Target.java
1    /* 
2     *Program to paint a target in the context of the Nonrepresentational 
3     * Painting World, NPW. 
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       //THE SOLUTION TO THE RED CIRCLE PROBLEM
14       private void paintTheImage() {
15           SPainter klee = new SPainter("Target", 600,600);
16           SCircle dot  = new SCircle (225);
17           klee.setColor(Color.RED);
18           klee.paint(dot);
19           SCircle circle = new SCircle (150);
20           klee.setColor(Color.WHITE);
21           klee.paint(circle);
22           SCircle whitecircle = new SCircle (75);
23           klee.setColor(Color.RED);
24           klee.paint(whitecircle);
25   
26       }
27   
28       //REQUIRED INFRASTRUCTURE
29   
30       public Target() {
31           paintTheImage();
32       }
33   
34       public static void main(String[] args) {
35           SwingUtilities.invokeLater(new Runnable() {
36               public void run() {
37                   new Target();
38               }
39           });
40       }
41   }
42