RedCross.java
1    package npw;
2    
3    import java.awt.Color;
4    import javax.swing.SwingUtilities;
5    import painter.SPainter;
6    import shapes.SRectangle;
7    
8    public class RedCross
9    {
10       //The solution to the red cross problem
11       private void paintTheImage()
12       {
13           SPainter klee = new SPainter("Red Cross", 600, 600);
14           SRectangle cross = new SRectangle(500,100);
15           klee.setColor(Color.RED);
16           klee.paint(cross);
17           klee.tl();
18           klee.paint(cross);
19   
20       }
21       //Required Infrastructure
22       public RedCross()
23       {
24           paintTheImage();
25       }
26   
27       public static void main(String[] args)
28       {
29           SwingUtilities.invokeLater(new Runnable()
30           {
31               public void run()
32               {
33                   new RedCross();
34               }
35           });
36       }
37   }