/* * Program to paint a red cross in the context of the Nonrepresentational * Painting World,, NPW. */ package npw; import java.awt.Color; import javax.swing.SwingUtilities; import painter.SPainter; import shapes.SRectangle; public class RedCross { // THE SOLUTION TO THE RED CROSS PROBLEM private void paintTheImage () { SPainter painter = new SPainter ("Red Cross", 600, 600); SRectangle rectangle = new SRectangle(110, 500); painter.setColor(Color.RED); painter.paint(rectangle); rectangle = new SRectangle(500, 110); painter.setColor(Color.RED); painter.paint(rectangle); } // REQUIRED INFRASTRUCTURE public RedCross() { paintTheImage(); } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new RedCross(); } }); } }