1 /* Program for RedCross from assignment 1 2 3 */ 4 5 6 package npw; 7 8 import java.awt.*; 9 import javax.swing.*; 10 11 import painter.SPainter; 12 import shapes.SRectangle; 13 14 public class RedCross { 15 16 private void paintTheImage (){ 17 SPainter klee= new SPainter("Red Cross",600,600); 18 SRectangle cross = new SRectangle(500,100); 19 klee.setColor(Color.RED); 20 klee.paint(cross); 21 // second rectangle 22 cross.resetHeight(100); 23 cross.resetWidth(500); 24 klee.paint(cross); 25 } 26 27 // REQUIRED INFRASTRUCTURE 28 public RedCross(){ 29 paintTheImage(); 30 } 31 public static void main (String[] args){ 32 SwingUtilities.invokeLater(new Runnable(){ 33 public void run(){ 34 new RedCross(); 35 } 36 }); 37 } 38 39 40 41 42 43 44 45 46 47 48 49 50 } 51