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