1 /* 2 * Program to paint a blue dot in the context of the Nonrepresentational 3 * Painting World, Npw. 4 */ 5 6 package npw; 7 8 import painter.SPainter; 9 import shapes.SRectangle; 10 11 import javax.swing.*; 12 import java.awt.*; 13 14 public class RedCross { 15 16 // THE SOLUTION TO THE BLUE DOT PROBLEM 17 private void paintTheImage() { 18 SPainter klee = new SPainter("Red Cross",450,450); 19 SRectangle Cross = new SRectangle(400, 75); 20 klee.setColor(Color.RED); 21 klee.paint(Cross); 22 klee.tl(); 23 klee.setColor(Color.RED); 24 klee.paint(Cross); 25 26 27 } 28 29 //REQUIRED INFRASTRUCTURE 30 31 public RedCross() { 32 paintTheImage(); 33 } 34 35 public static void main(String[] args) { 36 SwingUtilities.invokeLater(new Runnable() { 37 public void run() { 38 new RedCross(); 39 } 40 }); 41 } 42 } 43 44 45 46 47