RedCross.java
1    /* 
2     * Program to paint a Red Cross in the context of the Nonrepresentational 
3     * Painting World, NPW. 
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       // THE SOLUTION TO THE Red Cross PROBLEM
14       private void paintTheImage() {
15           SPainter klee = new SPainter ("Red Cross", 600, 600);
16           SRectangle dot = new SRectangle(500, 100);
17           klee.setColor(Color.RED);
18           klee.paint(dot);
19           klee.tl();
20           klee.paint(dot);
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   }