RedCross.java
1    package npw;
2    
3    import java.awt.Color;
4    import javax.swing.SwingUtilities;
5    import painter.SPainter;
6    import shapes.SCircle;
7    import shapes.SRectangle;
8    
9    public class RedCross {
10   
11       //THE SOLUTION TO THE RED CROSS PROBLEM
12   
13       private void paintTheImage() {
14           SPainter klee = new SPainter("Red Cross", 600,600);
15           SRectangle rectangle = new SRectangle(500,100);
16           klee.setColor(Color.RED);
17           klee.paint(rectangle);
18           klee.tl();
19           klee.paint(rectangle);
20           klee.tr();
21   
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   }
38