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 // THE SOLUTION TO THE BLUE DOT PROBLEM 12 private void paintTheImage() { 13 SPainter klee = new SPainter("Red Cross", 600, 600); 14 SRectangle dot = new SRectangle(500, 100); 15 klee.setColor(Color.RED); 16 klee.paint(dot); 17 18 // Turn the painter 19 klee.tl(); 20 klee.paint(dot); 21 } 22 23 // REQUIRED INFRASTRUCTURE 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 }