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