1 /* 2 * Program to paint the 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 ICON PROBLEM 15 16 private void paintTheImage() { 17 SPainter klee = new SPainter("Target",600,600); 18 SCircle dot = new SCircle(50); 19 SCircle ring = new SCircle(150); 20 21 klee.setColor(Color.RED); 22 klee.paint(ring); 23 24 SCircle white = new SCircle(100); 25 klee.setColor(Color.WHITE); 26 klee.paint(white); 27 28 klee.setColor(Color.RED); 29 klee.paint(dot); 30 31 32 } 33 34 // REQUIRED INFRASTRUCTURE 35 36 public Target() { 37 paintTheImage(); 38 } 39 40 public static void main(String[] args) { 41 SwingUtilities.invokeLater(new Runnable() { 42 public void run() { 43 new Target(); 44 } 45 }); 46 } 47 48 } 49 50