1 /* 2 * Program to paint a Target icon 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 import static shapes.SCircle.*; 14 15 public class Target { 16 private void paintTheImage() { 17 SPainter klee = new SPainter("Target", 600,600); 18 SCircle dot = new SCircle(200); 19 20 //First Red Circle 21 klee.setColor(Color.RED); 22 klee.paint(dot); 23 24 //White Circle 25 dot.s3(); 26 dot.x2(); 27 klee.setColor(Color.WHITE); 28 klee.paint(dot); 29 30 //Second Red Circle 31 dot.s2(); 32 klee.setColor(Color.RED); 33 klee.paint(dot); 34 35 } 36 37 //REQUIRED INFRASTRUCTURE 38 39 public Target() { 40 paintTheImage(); 41 } 42 43 public static void main(String[] args) { 44 SwingUtilities.invokeLater(new Runnable() { 45 public void run() { 46 new Target(); 47 } 48 }); 49 } 50 }