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