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