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