1 /* 2 * Program to paint a green t 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 GreenT { 14 15 //THE SOLUTION TO THE GREEN T PROBLEM 16 17 private void paintTheImage() { 18 SPainter klee = new SPainter("GreenT",600,600); 19 SRectangle box = new SRectangle(400, 100); 20 klee.setColor(Color.GREEN); 21 klee.paint(box); 22 box.setHeight(100); 23 box.setWidth(400); 24 klee.mfd(200); 25 klee.paint(box); 26 27 } 28 29 //INFRASTRUCTURE REQUIRED 30 31 public GreenT() { 32 paintTheImage(); 33 } 34 35 public static void main(String[] args) { 36 SwingUtilities.invokeLater(new Runnable() { 37 public void run() { 38 new GreenT(); 39 } 40 }); 41 } 42 } 43 44