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