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