1 /* 2 *Program to paint a target icon in the context of the nonrepresentational 3 * painting world, NPW. 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 // THE SOLUTION TO THE Target PROBLEM 15 private void paintTheImage() { 16 SPainter klee = new SPainter("Target",400,400); 17 18 SCircle dot =new SCircle(150); 19 klee.setColor(Color.red); 20 klee.paint(dot); 21 SCircle dot1 = new SCircle(100); 22 klee.setColor(Color.white); 23 klee.paint(dot1); 24 SCircle dot2 = new SCircle(50); 25 klee.setColor(Color.red); 26 klee.paint(dot2); 27 28 } 29 // REQUIRED INFRASTRUCTURE 30 public Target() { 31 paintTheImage(); 32 } 33 public static void main(String[] args) { 34 SwingUtilities.invokeLater(new Runnable() { 35 public void run() { 36 new Target(); 37 38 } 39 }); 40 } 41 } 42 43 44