1 package npw; 2 /* 3 * Program to paint a red cross in the context of the Nonrepresentational Painting World, NPW 4 */ 5 6 import java.awt.Color; 7 import javax.swing.SwingUtilities; 8 import painter.SPainter; 9 import shapes.SRectangle; 10 11 public class RedCross { 12 //THE SOLUTION TO THE RED CROSS PROBLEM 13 14 private void paintTheImage() 15 { 16 SPainter klee = new SPainter("Red Cross", 600, 600); 17 SRectangle rectangle = new SRectangle(500, 100); 18 klee.setColor(Color.RED); 19 klee.paint(rectangle); 20 rectangle.resetHeight(100); 21 rectangle.resetWidth(500); 22 klee.paint(rectangle); 23 } 24 25 //REQUIRED INFRASTRUCTURE 26 27 public RedCross() 28 { 29 paintTheImage(); 30 } 31 32 public static void main(String[] args) 33 { 34 SwingUtilities.invokeLater(new Runnable() 35 { 36 public void run(){ 37 new RedCross(); 38 } 39 }); 40 } 41 } 42