Target.java
1    /* 
2    *program to paint a target 
3    * consists of a red dot and a white dot 
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   
14   public class Target {
15   
16       private void paintTheImage() {
17           SPainter klee = new SPainter("Target", 800, 800);
18           SCircle bdot = new SCircle(300);
19           klee.setColor(Color.RED);
20           klee.paint(bdot);
21   
22                                                                                                                           // white circle
23           SCircle wdot = new SCircle(200);
24           klee.setColor(Color.WHITE);
25           klee.paint(wdot);
26   
27                                                                                                                           //small red circle
28           SCircle sdot = new SCircle(100);
29           klee.setColor(Color.RED);
30           klee.paint(sdot);
31   
32   
33   
34   
35   
36       }
37   
38                                                                                                                           //REQUIRED INFRASTRUCTURE
39   
40       public Target() {
41           paintTheImage();
42       }
43   
44       public static void main(String[] args) {
45           SwingUtilities.invokeLater(new Runnable() {
46               public void run() {
47                   new Target();
48               }
49           });
50       }
51   }
52   
53