1 /* 2 A program to paint a red cross in the context of the NPW 3 */ 4 5 package npw; 6 import java.awt.Color; 7 import javax.swing.SwingUtilities; 8 import painter.SPainter; 9 import shapes.SRectangle; 10 11 public class RedCross { 12 private void paintTheImage() { 13 SPainter klee = new SPainter("Red Cross",600,600); 14 SRectangle leg = new SRectangle(500,100); 15 klee.setColor(Color.RED); 16 klee.paint(leg); 17 klee.tl(); 18 klee.paint(leg); 19 } 20 //REQUIRED INFRASTRUCTURE 21 public RedCross () {paintTheImage();} 22 public static void main(String args[]) { 23 SwingUtilities.invokeLater(new Runnable() { 24 public void run() { 25 new RedCross(); 26 } 27 }); 28 } 29 } 30