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