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 SRectangle brick = new SRectangle(100, 500); 15 klee.setColor(Color.RED); 16 klee.paint(brick); 17 brick.expand(400, -400); 18 klee.paint(brick); 19 } 20 21 //required infrastructure 22 23 public RedCross() { 24 paintTheImage(); 25 } 26 27 public static void main(String[] args) { 28 SwingUtilities.invokeLater(new Runnable() { 29 public void run() { 30 new RedCross(); 31 } 32 }); 33 } 34 } 35 36