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