1 /* 2 * Program to paint a Target. 3 * Painting World, NPW. 4 */ 5 6 package npw; 7 import java.awt.Color; 8 import javax.swing.SwingUtilities; 9 import painter.SPainter; 10 import shapes.SCircle; 11 12 public class Target { 13 private void paintTheImage() { 14 SPainter klee = new SPainter("Target" ,600,600); 15 SCircle dot = new SCircle(200); 16 klee.setColor(Color.RED); 17 klee.paint(dot); 18 dot = new SCircle(100); 19 klee.setColor(Color.WHITE); 20 klee.paint(dot); 21 dot = new SCircle(50); 22 klee.setColor(Color.RED); 23 klee.paint(dot); 24 } 25 //REQUIRED INFRASTRUCTURE 26 public Target(){ 27 paintTheImage(); 28 } 29 public static void main(String[] args){ 30 SwingUtilities.invokeLater(new Runnable(){ 31 public void run() { 32 new Target(); 33 } 34 }); 35 } 36 }