GreenT.java
1    /* 
2    *Program to paint a green T in the context of the Non-representational Painting World 
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   import static painter.SPainter.*;
13   
14   public class GreenT {
15       //Solution to the GreenT problem
16       private void paintTheImage(){
17           SPainter frida = new SPainter("Green T", 600, 600);
18           SRectangle rect = new SRectangle(400, 100);
19           frida.setColor(Color.GREEN);
20           frida.paint(rect);
21   
22           //Turning the painter
23           frida.tl();
24           frida.mrt(250);
25           frida.paint(rect);
26       }
27   
28       //Required Infrastucture
29   
30       public GreenT(){
31           paintTheImage();
32       }
33   
34       public static void main (String[] args){
35           SwingUtilities.invokeLater(new Runnable() {
36               public void run(){
37                   new GreenT();
38               }
39           });
40       }
41   }
42