RedCross.java
1    /* 
2     * Program to paint a blue dot in the context of Nonrepresentational 
3     * Painting World, NPW. 
4     */
5    
6    package npw;
7    
8    import java.awt.Color;
9    import javax.swing.SwingUtilities;
10   import painter.SPainter;
11   import shapes.SCircle;
12   import shapes.SRectangle;
13   
14   public class RedCross {
15   
16       // THE SOLUTION TO THE BLUE DOT PROBLEM
17   
18       private void paintTheImage() {
19           SPainter klee = new SPainter("Red Cross", 600, 600);
20           SRectangle cross = new SRectangle(500,100);
21           klee.setColor(Color.RED);
22           klee.paint(cross);
23           klee.tr();
24           klee.paint(cross);
25   
26       }
27   
28       // Required Infrastructure
29   
30       public RedCross() {
31           paintTheImage();
32       }
33   
34       public static void main(String[] args)  {
35           SwingUtilities.invokeLater(new Runnable() {
36               public void run() {
37                   RedCross RedCross = new RedCross();
38               }
39           });
40       }
41   
42   }
43