RedCross.java
1    /* 
2     * The painting of a red cross.(Assignment 1) 
3     */
4    package npw;
5    
6    import java.awt.*;
7    import javax.swing.SwingUtilities;
8    import painter.SPainter;
9    import shapes.SRectangle;
10   
11   public class RedCross {
12   
13       private void paintTheImage() {
14           SPainter max = new SPainter("Red Cross" ,600,600);
15           SRectangle bob = new SRectangle(500,100);
16           SRectangle bill = new SRectangle(100,500);
17           max.setColor(Color.RED);
18           max.paint(bob);
19           max.paint(bill);
20       }
21   
22       public RedCross() {
23           paintTheImage();
24       }
25   
26       public static void main(String[] args) {
27           SwingUtilities.invokeLater(new Runnable() {
28               public void run() {
29                   new RedCross();
30               }
31           });
32       }
33   }
34