RedCross.java
1    package npw;
2    
3    import java.awt.*;
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 PROGRAM
12   
13       private void paintTheImage() {
14           SPainter klee = new SPainter("Red Cross", 600,600);
15           SRectangle rectangle = new SRectangle(75, 600);
16           klee.setColor(Color.red);
17           klee.paint(rectangle);
18           klee.tl();
19           klee.paint(rectangle);
20   
21       }
22   
23       //REQUIRED INFRASTRUCTURE
24   
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