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