1 /* 2 * Program to paint a blue dot in 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 RedX { 13 14 //The solution to the Blue Dot problem. 15 16 private void paintTheImage() { 17 SPainter klee = new SPainter("Red X", 600, 600); 18 SRectangle rect = new SRectangle(500,100); 19 klee.setColor(Color.RED); 20 21 klee.tl(45); 22 klee.paint(rect); 23 24 klee.tr(90); 25 klee.paint(rect); 26 27 klee.tl(45); 28 } 29 30 public RedX() { 31 paintTheImage(); 32 } 33 34 public static void main(String[] args) { 35 SwingUtilities.invokeLater(new Runnable() { 36 public void run() { 37 new RedX(); 38 } 39 }); 40 } 41 42 } 43