/* * Program to paint a Red Cross in the context of the nonrepresentational * Painting world, NPW */ package npw; import painter.SPainter; import shapes.SCircle; import shapes.SRectangle; import shapes.SSquare; import javax.swing.*; import java.awt.*; public class RedCross { private void paintTheImage() { SPainter painter = new SPainter("Red Cross", 600, 600); //initializes the base rectangle and paints it SRectangle r1 = new SRectangle(500, 500); painter.setColor(Color.red); painter.paint(r1); //Sets painter to white and colors squares painter.setColor(Color.white); painter.mfd(200); painter.mrt(200); SSquare s1 = new SSquare(300); painter.paint(s1); painter.mlt(400); SSquare s2 = new SSquare(300); painter.paint(s2); painter.mbk(400); SSquare s3 = new SSquare(300); painter.paint(s3); painter.mrt(400); SSquare s4 = new SSquare(300); painter.paint(s4); } public RedCross() { paintTheImage(); } public static void main(String[] args) { SwingUtilities.invokeLater (new Runnable() { public void run() { new RedCross(); } }); } }