RedCross.java
1    /* 
2     * This program will paint a red cross in the context of NPW 
3     */
4    
5    package npw;
6    
7    import painter.SPainter;
8    import shapes.SCircle;
9    import shapes.SRectangle;
10   
11   import javax.swing.*;
12   import java.awt.*;
13   
14   public class RedCross {
15   
16       private void paintTheImage(){
17           SPainter kira = new SPainter ("Red Cross",600,600);
18           SRectangle rec = new SRectangle(500, 100);
19           kira.setColor(Color.RED);
20           kira.paint(rec);
21           kira.tl();
22           kira.paint(rec);
23   
24       }
25   
26       // REQUIRED INFRASTRUCTURE
27   
28       public RedCross() {
29           paintTheImage();
30       }
31   
32       public static void main (String[] args) {
33           SwingUtilities.invokeLater(new Runnable() {
34               public void run() {
35                   new RedCross();
36               }
37           });
38       }
39   }
40