Target.java
1    /*Program to paint a target in the context of the Nonrepresentational 
2      Painting World, NPW. 
3     
4     */
5    
6    package npw;
7    
8    import java.awt.Color;
9    import javax.swing.SwingUtilities;
10   import painter.SPainter;
11   import shapes.SCircle;
12   
13   public class Target {
14   
15       // The solution to the target problem
16   
17       private void paintTheImage() {
18           //Create a painter
19           SPainter Justin = new SPainter("Target",600,600);
20           //Create a circle with radius r
21           SCircle circle = new SCircle(230);
22           Justin.setColor(Color.RED);
23           //Sets brush width
24           Justin.setBrushWidth(70);
25           //Draws the circle
26           Justin.draw(circle);
27           circle.setRadius(95);
28           //Paint inner target circle
29           Justin.paint(circle);
30       }
31   
32       // Required infrastructure \
33   
34       public Target() {
35           paintTheImage();
36       }
37   
38       public static void main(String[] args) {
39           SwingUtilities.invokeLater(new Runnable() {
40               public void run() {
41                   new Target();
42               }
43           });
44       }
45   }
46