OO Programming in Java

AWT Examples



The Java code for three GUI examples are provided below


Example One

Example Two

Example Three

Please read information below

Summary:

Example Two Extensions

Extension

Description

SCView This provides functionality to handle the widgetDictionary which stores all widget references in a Hashtable.
OOButton Each visible button is a separate subclass of this extension. Simply place the method call you wish to execute (when the button is pressed) in the main view inside the OOButton's method called pressed()
OOTextField Each visible textField is a separate subclass of this extension. Simply place the method call you wish to execute (when the return key is pressed) in the main view inside the OOTextField's method called carriageReturn()

Example Three Extensions

Extension

Description

ButtonCanvas Extend this class and read two images (GIF files) from disk. One of the images is displayed when the button is released, the other when the button is pressed.