1 package npw; 2 3 import painter.SPainter; 4 import shapes.SRectangle; 5 import javax.swing.SwingUtilities; 6 import java.awt.Color; 7 8 9 10 public class RedCross { 11 12 13 14 private void paintTheImage() { 15 16 SPainter klee = new SPainter("Red Cross", 600, 600); 17 SRectangle block = new SRectangle(500, 100); 18 klee.setColor(Color.RED); 19 klee.paint(block); 20 klee.tl(); 21 klee.paint(block); 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 38