interpreter3.java
package interpreters;

 import javax.swing.JOptionPane;
 import java.awt.Color;
 import javax.swing.SwingUtilities;
 import painter.SPainter;
 import shapes.SCircle;
 public class interpreter3 {
      private void interpreter()
     {
                 SPainter micro = new SPainter("Dot Thing",400,400);
                 micro.setScreenLocation(0,0);
                 SCircle dot = new SCircle(180);
               while(true)
                     {
                         String command = JOptionPane.showInputDialog(null,"Command?");
                         if(command==null) { command="exit"; } // user clicked Cancel
                         if(command.equalsIgnoreCase("blue"))
                        {
                             micro.setColor(Color.BLUE);
                          micro.paint(dot);
                        }
                         else if(command.equalsIgnoreCase("red"))
                         {
                             micro.setColor(Color.RED);
                            micro.paint(dot);
                         }
                       else if(command.equalsIgnoreCase("green"))
                            {
                                micro.setColor(Color.GREEN);
                                micro.paint(dot);
                            }
                         else if(command.equalsIgnoreCase("yellow"))
                      {
                          micro.setColor(Color.YELLOW);
                            micro.paint(dot);
                         }
                         else if(command.equalsIgnoreCase("random"))
                         {
                         micro.setColor(randomColor());
                           micro.paint(dot);

                      }
                         else if(command.equalsIgnoreCase("help"))
                         {
                             JOptionPane.showMessageDialog(null," Valid comments are :"+"RED|BLUE|GREEN|YELLOW|RANDOM|HELP|EXIT");
                         }
                       else if(command.equalsIgnoreCase("exit"))
                             {
                                micro.end();
                                 System.out.println("Thank You for viewing the dots...");
              break;

            }
             else
             {
                 JOptionPane.showMessageDialog(null, "Unrecognizable command:"+command.toUpperCase());
             }
         }
     }

  public interpreter3()
     {
         interpreter();
  }
     public static void main(String[] args) {
         SwingUtilities.invokeLater(new Runnable(){
             public void run() {
        new interpreter3();
             }
         });
     }

             private static  Color randomColor() {
             int rv = (int) (Math.random()*256);
             int gv= (int) (Math.random()*256);
             int bv = (int) (Math.random()*256);
             return new Color(rv,gv,bv);

         }
 }