1 /* 2 *Program to paint a target logo 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 // THE SOLUTION TO THE TARGET LOGO PROBLEM 15 private void paintTheImage() { 16 SPainter klee = new SPainter("Target", 600, 600); 17 SCircle dot = new SCircle(250); 18 klee.setColor(Color.RED); 19 klee.paint(dot); 20 SCircle ring = new SCircle(150); 21 klee.setColor(Color.WHITE); 22 klee.paint(ring); 23 SCircle circle = new SCircle(75); 24 klee.setColor(Color.RED); 25 klee.paint(circle); 26 } 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 } 42 } 43 44