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