1 /* 2 * Program to paint the Target icon in the context of the Nonrepresentational 3 * Painting World, NPW. 4 */ 5 package npw; 6 7 import java.awt.Color; 8 import javax.swing.SwingUtilities; 9 import painter.SPainter; 10 import shapes.SCircle; 11 12 public class Target { 13 // The solution to painting the Target icon 14 private void paintTheImage() { 15 SPainter klee = new SPainter("Target",1000,1000); 16 SCircle dot3 = new SCircle(300); 17 klee.setColor(Color.red); 18 klee.paint(dot3); 19 SCircle dot2 = new SCircle(200); 20 klee.setColor(Color.white); 21 klee.paint(dot2); 22 SCircle dot = new SCircle(100); 23 klee.setColor(Color.RED); 24 klee.paint(dot); 25 } 26 //Required infrastructure 27 public Target() { 28 paintTheImage(); 29 } 30 public static void main(String[]args) { 31 SwingUtilities.invokeLater(new Runnable() { 32 public void run(){ 33 new Target(); 34 } 35 }); 36 } 37 } 38