1 /* 2 * Program to paint a RedCross 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 import shapes.SRectangle; 13 14 public class RedCross { 15 16 // THE SOLUTION TO RedCross Problem 17 private void paintTheImage() { 18 SPainter klee = new SPainter("RedCross", 600 ,600); 19 SRectangle dot = new SRectangle(500,100); 20 klee.setColor(Color.red) ; 21 klee.paint(dot); 22 klee.tl(); 23 klee.paint(dot); 24 } 25 26 // REQUIRED INFRASTRUCTURE 27 28 public RedCross() { 29 paintTheImage(); 30 } 31 32 public static void main(String[] args) { 33 SwingUtilities.invokeLater(new Runnable() { 34 public void run() { 35 new RedCross(); 36 } 37 38 }); 39 40 } 41 42 } 43 44 45 46 47 48