| java.lang.Object org.millstone.base.Application org.millstone.examples.Calc
Calc | public class Calc extends org.millstone.base.Application implements Button.ClickListener(Code) | | An example application implementing a simple web-based calculator.
using the MillStone UI library. The application opens up a window and
places the needed UI components (display label, buttons etc.) on it, and
registers a button click listener for them.
When any of the buttons are pressed the application finds out which
button was pressed, figures what that button does, and updates the user
interface accordingly.
See Also: org.millstone.base.Application See Also: org.millstone.base.ui.Button.ClickListener |
Method Summary | |
public void | buttonClick(Button.ClickEvent event) The button listener method called any time a button is pressed.
This method catches all button presses, figures out what the user
wanted the application to do, and updates the UI accordingly.
The button click event passed to this method contains information
about which button was pressed. | public void | init() Initializes the application. |
buttonClick | public void buttonClick(Button.ClickEvent event)(Code) | | The button listener method called any time a button is pressed.
This method catches all button presses, figures out what the user
wanted the application to do, and updates the UI accordingly.
The button click event passed to this method contains information
about which button was pressed. If it was a number, the currently
edited number is updated. If it was something else, the requested
operation is performed. In either case the display label is updated
to include the outcome of the button click.
Parameters: event - the button click event specifying which button waspressed |
init | public void init()(Code) | | Initializes the application. This is the only method a MillStone
application is required to implement. It's called by the framework
and it should perform whatever initialization tasks the application
needs to perform.
In this case we create the main window, the display, the grid to
hold the buttons, and the buttons themselves.
|
|
|