1 /* 2 * Paints a red cross 3 */ 4 5 package npw; 6 7 // Imports // 8 import java.awt.Color; 9 import javax.swing.SwingUtilities; 10 import painter.SPainter; 11 import shapes.SCircle; 12 import shapes.SRectangle; 13 14 // Main Code // 15 public class RedCross { 16 // Solution to the RedCross Problem 17 18 private void paintTheImage(){ 19 SPainter klee = new SPainter("Red Cross", 600, 600); 20 SRectangle leg = new SRectangle(500,100); 21 klee.setColor(Color.RED); 22 klee.paint(leg); 23 leg.setWidth(500); 24 leg.setHeight(100); 25 klee.paint(leg); 26 } 27 28 // REQUIRED INFRASTRUCTURE // 29 30 public RedCross(){ 31 paintTheImage(); 32 } 33 34 public static void main(String[] args){ 35 SwingUtilities.invokeLater(new Runnable(){ 36 public void run(){ 37 new RedCross(); 38 } 39 }); 40 } 41 } 42