RedCross.java
1    /* 
2     * Program to paint a red cross in the context of the Nonrepresentational 
3     * Painting World, NPW 
4     */
5    
6    package npw;
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 RedCross PROBLEM
14   
15       private void paintTheImage() {
16           SPainter klee = new SPainter("RedCross" ,700,600);
17           SRectangle nono = new SRectangle(100,400);
18           klee.setColor(Color.RED);
19           klee.paint(nono);
20           klee.tl();
21           klee.paint(nono);
22       }
23       //REQUIRED INFRASTRUCTURE
24       public RedCross(){
25           paintTheImage();
26       }
27       public static void main(String[] args){
28           SwingUtilities.invokeLater(new Runnable(){
29               public void run() {
30                   new RedCross();
31               }
32           });
33       }
34   }