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