1 /* 2 *Program to paint a target sign in npw 3 */ 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",600,600); 18 SCircle big = new SCircle(200); 19 klee.setColor(Color.red); 20 klee.paint(big); 21 SCircle med = new SCircle(150); 22 klee.setColor(Color.white); 23 klee.paint(med); 24 SCircle little = new SCircle(100); 25 klee.setColor(Color.red); 26 klee.paint(little); 27 } 28 29 //required infrastructure 30 31 public Target() { 32 paintTheImage(); 33 } 34 35 public static void main(String[] args) { 36 SwingUtilities.invokeLater(new Runnable() { 37 public void run() { 38 new Target(); 39 } 40 }); 41 } 42 }