FileDocCategorySizeDatePackage
Scribble5.javaAPI DocExample4102Sat Jun 02 02:43:26 BST 2001None

Scribble5

public class Scribble5 extends Object
The application class. Processes high-level commands sent by GUI

Fields Summary
protected Frame
window
Constructors Summary
public Scribble5()
Application constructor: create an instance of our GUI class

 window = new ScribbleGUI(this); 
Methods Summary
public voiddoCommand(java.lang.String command)
This is the application method that processes commands sent by the GUI

    if (command.equals("clear")) {          // clear the GUI window
      // It would be more modular to include this functionality in the GUI
      // class itself.  But for demonstration purposes, we do it here.
      Graphics g = window.getGraphics();
      g.setColor(window.getBackground());
      g.fillRect(0, 0, window.getSize().width, window.getSize().height);
    }
    else if (command.equals("print")) {}    // not yet implemented
    else if (command.equals("quit")) {      // quit the application
      window.dispose();                         // close the GUI
      System.exit(0);                           // and exit.
    }
  
public static voidmain(java.lang.String[] args)
main entry point. Just create an instance of this application class

 new Scribble5();