/* * */ package npw; import java.awt.Color; import javax.swing.SwingUtilities; import painter.SPainter; import shapes.SSquare; public class RedCross { //The solution to RedCross Problem private void paintTheImage(){ SPainter clay = new SPainter("RedCross", 600,600); SSquare square = new SSquare(500); clay.setColor(Color.RED); clay.paint(square); SSquare UpLeft = new SSquare(200); clay.setColor(Color.WHITE); clay.mlt(150); clay.mfd(150); clay.paint(UpLeft); clay.moveToCenter(); SSquare UpRight = new SSquare(200); clay.setColor(Color.WHITE); clay.mrt(150); clay.mfd(150); clay.paint(UpRight); clay.moveToCenter(); SSquare DownLeft = new SSquare(200); clay.setColor(Color.WHITE); clay.mlt(150); clay.mbk(150); clay.paint(DownLeft); clay.moveToCenter(); SSquare DownRight = new SSquare(200); clay.setColor(Color.WHITE); clay.mrt(150); clay.mbk(150); clay.paint(DownRight); clay.moveToCenter(); // REQUIRED INFRASTRUCTURE }; public RedCross() {paintTheImage();} public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { new RedCross(); } }); } };