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