1 2 /* 3 *Program to paint a Target Icon in the context of the Nonrepresentational 4 * Painting World, NPW. 5 */ 6 7 package NPW; 8 9 import painter.SPainter; 10 import shapes.SCircle; 11 import javax.swing.*; 12 import java.awt.*; 13 14 public class Target { 15 16 // THE SOLUTION TO THE Target PROBLEM 17 18 private void paintTheImage() { 19 SPainter Klee = new SPainter("Target Icon", 800,800); 20 21 SCircle reddot1 = new SCircle(300); 22 Klee.setColor(Color.red); 23 Klee.paint(reddot1); 24 25 SCircle whitedot = new SCircle(200); 26 Klee.setColor(Color.white); 27 Klee.paint(whitedot); 28 29 SCircle reddot2 = new SCircle(100); 30 Klee.setColor(Color.red); 31 Klee.paint(reddot2); 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 }