1 // REQUIRED I 2 3 package npw; 4 5 import java.awt.Color; 6 import javax.swing.SwingUtilities; 7 import painter.SPainter; 8 import shapes.SCircle; 9 import shapes.SRectangle; 10 11 public class RedCross { 12 13 14 // SOLUTION TO BLUE DOT PROBLEM 15 16 private void paintTheImage(){ 17 SPainter klee = new SPainter("Red Cross",600,600); 18 SRectangle cross = new SRectangle(300,70); 19 klee.setColor(Color.RED); 20 klee.paint(cross); 21 klee.moveToCenter(); 22 cross.resetHeight(70); 23 cross.resetWidth(300); 24 klee.paint(cross); 25 26 } 27 28 // REQUIRED INFRASTRUCTURE 29 public RedCross(){ 30 paintTheImage(); 31 32 } 33 34 public static void main(String[] args){ 35 SwingUtilities.invokeLater(new Runnable(){ 36 public void run(){ 37 new RedCross(); 38 } 39 40 }); 41 }} 42