RedCross.java
1    /* 
2    program to paint a red cross. 
3     */
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       private void paintTheImage() {
14           SPainter walker = new SPainter("Red Cross", 600,600);
15           SRectangle one = new SRectangle(100, 500);
16           walker.setColor(Color.red);
17           walker.paint(one);
18           walker.tl();
19           walker.paint(one);
20       }
21   
22       // required infrastructure
23       public RedCross() {
24           paintTheImage();
25       }
26   
27       public static void main(String[] args) {
28           SwingUtilities.invokeLater(new Runnable() {
29               public void run() {
30                   new RedCross();
31               }
32           });
33       }
34   }
35