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