Target.java
1    /* 
2     * Program to paint a Target 
3     * Painting World, npw. 
4     * Modified By Miguel Cruz | Lab 2 
5     */
6    package npw;
7    
8    import painter.SPainter;
9    import shapes.SCircle;
10   
11   import javax.swing.*;
12   import java.awt.*;
13   public class Target {
14       // THE SOLUTION TO THE BLUE DOT PROBLEM
15       private void paintTheImage() {
16           SPainter target = new SPainter("Target",600,600);
17           SCircle ColoredBGLayer = new SCircle(200);
18           SCircle WhiteLayer= new SCircle(125);
19           SCircle DotLayer= new SCircle(50);
20           // Step 1
21           target.setColor(Color.RED);
22           target.paint(ColoredBGLayer);
23           // Step 2
24           target.setColor(Color.WHITE);
25           target.paint(WhiteLayer);
26           // Step 3
27           target.setColor(Color.RED);
28           target.paint(DotLayer);
29   
30   
31   
32       }
33       // REQUIRED INFRASTRUCTURE
34       public Target() {
35           paintTheImage();
36       }
37       public static void main(String[] args) {
38           SwingUtilities.invokeLater(new Runnable() {
39               public void run() {
40                   new Target();
41               }
42           });
43       }
44   }