Section 8.5. GUI Classes


8.5. GUI Classes

The main purpose of the onModuleLoad() method is to build the GUI and handle the button's click event. Most of the GUI classes derive from the com.google.gwt.user.client.ui package, a part of the GWT API.

For example, the code uses a FormPanel and places a Grid or HTML table inside the form in order to position the Labels, TextBoxes, and Button.

NOTE

The code instantiates a few of the GUI elements, a FormPanel and a Grid, outside of the onModuleLoad() method. In other words, they are instance variables rather than local variables. As a result, a JUnit test-case class can use a getter method to access the Grid, for instance, and test the state of the widgets inside of it.

The TextBoxes cannot be edited by the user, since they only have a display purpose (TextBox.setEnabled(false)).




Google Web Toolkit for Ajax
Google Web Toolkit GWT Java AJAX Programming: A step-by-step to Google Web Toolkit for creating Ajax applications fast
ISBN: 1847191002
EAN: 2147483647
Year: 2006
Pages: 29

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net