1 /* 2 * Program to paint a blue dot 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 14 // THE SOLUTION TO THE TARGET PROBLEM 15 16 private void paintTheImage() { 17 SPainter klee = new SPainter("Target",1000,1000); 18 SCircle dot = new SCircle(450); 19 klee.setColor(Color.RED); 20 klee.paint(dot); 21 dot = new SCircle(300); 22 klee.setColor(Color.WHITE); 23 klee.paint(dot); 24 dot = new SCircle(150); 25 klee.setColor(Color.RED); 26 klee.paint(dot); 27 } 28 // REQUIRED INFRASTRUCTURE 29 30 public Target() { 31 paintTheImage(); 32 } 33 34 public static void main(String[] args) { 35 SwingUtilities.invokeLater(new Runnable() { 36 public void run() { 37 new Target(); 38 } 39 }); 40 } 41 }