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