1 package npw; 2 3 import painter.SPainter; 4 import shapes.SRectangle; 5 6 import javax.swing.*; 7 import java.awt.*; 8 9 10 11 public class RedCross { 12 13 private void paintTheImage() { 14 SPainter paintBrush = new SPainter("Red Cross",600,600); 15 SRectangle rectangle = new SRectangle(500,100); 16 17 paintBrush.setColor(Color.RED); 18 paintBrush.paint(rectangle); 19 paintBrush.moveToCenter(); 20 paintBrush.tl(); 21 paintBrush.paint(rectangle); 22 } 23 // REQUIRED INFRASTRUCTURE 24 public RedCross() { 25 paintTheImage(); 26 } 27 public static void main(String[] args) { 28 SwingUtilities.invokeLater(new Runnable() { //Static 29 public void run() { 30 new RedCross(); 31 } 32 }); 33 } 34 35 36 } 37