1 package npw; 2 3 4 import java.awt.Color; 5 import javax.swing.SwingUtilities; 6 import painter.SPainter; 7 import shapes.SCircle; 8 9 public class Target { 10 // THE SOLUTION TO THE Target PROBLEM 11 private void paintTheImage() { 12 SPainter klee = new SPainter("Red dot",800,800); 13 SCircle dot = new SCircle(300); 14 klee.setColor(Color.RED); 15 klee.paint(dot); 16 17 SCircle wdot = new SCircle(200); 18 klee.setColor(Color.white); 19 klee.paint(wdot); 20 21 SCircle rdot = new SCircle(100); 22 klee.setColor(Color.red); 23 klee.paint(rdot); 24 } 25 26 // REQUIRED INFRASTRUCTURE 27 28 public Target() { 29 paintTheImage(); 30 } 31 32 public static void main(String[] args) { 33 SwingUtilities.invokeLater(new Runnable() { 34 public void run() { 35 new Target(); 36 } 37 }); 38 } 39 } 40