RedCross.java
1    package npw;
2    import java.awt.Color;
3    import javax.swing.SwingUtilities;
4    import painter.SPainter;
5    import shapes.SCircle;
6    import shapes.SRectangle;
7    
8    
9    public class RedCross {
10     //The solution to the Red Cross
11   
12       private void paintTheImage() {
13           SPainter klee = new SPainter("Red Cross", 600, 600);
14           SRectangle rectangle = new SRectangle (100, 500);
15           klee.setColor(Color.RED);
16           klee.paint(rectangle);
17           klee.tl();
18           klee.paint(rectangle);
19   
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() {
29                   new RedCross();
30   
31               }
32           });
33       }
34   
35   
36   
37   
38   
39   
40   }
41