RedCross.java
1    package npw;
2    
3    import java.awt.*;
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 rectangle = new SRectangle(500, 100);
15               klee.setColor(Color.red);
16               klee.paint(rectangle);
17   
18               klee.tl();
19               klee.paint(rectangle);
20           }
21   
22           //REQUIRED INFRASTRUCTURE
23       public RedCross() {
24           paintTheImage();
25       }
26       public static void main(String[] args) {
27           SwingUtilities.invokeLater(new Runnable() {
28               public void run() {new RedCross(); }
29   
30           });
31       }
32   }