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