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 //THE SOLUTION TO THE RED CROSS PROBLEM 10 private void paintTheImage() { 11 SPainter klee = new SPainter("Red Cross",600,600); 12 SRectangle box = new SRectangle (500.0,100.0); 13 klee.setColor(Color.RED); 14 klee.paint(box); 15 box.expand(-400, 400); 16 klee.paint(box); 17 } 18 19 //REQUIRED INFRASTRUCTURE 20 21 public RedCross() { 22 paintTheImage(); 23 } 24 25 public static void main(String[] args) { 26 SwingUtilities.invokeLater(new Runnable() { 27 public void run() { 28 new RedCross(); 29 } 30 }); 31 } 32 } 33