1 /* 2 Program to paint a target in the context of the Nonrepresentational 3 Painting World, NPW 4 */ 5 6 package npw; 7 import java.awt.Color; 8 import javax.swing.SwingUtilities; 9 import painter.SPainter; 10 import shapes.SCircle; 11 public class Target { 12 // THE SOLUTION TO THE TARGET PROBLEM 13 private void paintTheImage() { 14 SPainter klee = new SPainter("Target",600,600); 15 SCircle dot = new SCircle(200); 16 klee.setColor(Color.RED); 17 klee.paint(dot); 18 SCircle dot2 = new SCircle(125); 19 klee.setColor(Color.WHITE); 20 klee.paint(dot2); 21 SCircle dot3 = new SCircle(50); 22 klee.setColor(Color.RED); 23 klee.paint(dot3); 24 } 25 // REQUIRED INFRASTRUCTURE 26 public Target() { 27 paintTheImage(); 28 } 29 public static void main(String[] args) { 30 SwingUtilities.invokeLater(new Runnable() { 31 public void run() { 32 new Target(); 33 } 34 }); 35 } 36 } 37