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