1 package npw; 2 3 import java.awt.Color; 4 import javax.swing.SwingUtilities; 5 import painter.SPainter; 6 import shapes.SRectangle; 7 8 public class RedCross { 9 10 //THE SOLUTION TO THE Red Cross PROBLEM 11 12 private void paintTheImage() { 13 SPainter klee = new SPainter(" Red Cross", 600, 600); 14 klee.tl(); 15 SRectangle dot = new SRectangle(500, 100); 16 klee.setColor(Color.RED); 17 klee.paint(dot); 18 dot.resetHeight(100); 19 dot.resetWidth(500); 20 klee.paint(dot); 21 } 22 23 // REQUIRED INFRASTRUCTURE 24 25 public RedCross() { 26 paintTheImage(); 27 } 28 29 public static void main(String[] args) { 30 SwingUtilities.invokeLater(new Runnable() { 31 public void run() { 32 new RedCross(); 33 } 34 }); 35 } 36 } 37 38 39 40