|
The public class TheButton extends CustomComponent
implements Button.ClickListener {
Button thebutton;
public TheButton() {
// Create a Button with the given caption.
thebutton = new Button ("Do not push this button");
// Listen for ClickEvents.
thebutton.addListener(this);
setCompositionRoot(thebutton);
}
/** Handle click events for the button. */
public void buttonClick (Button.ClickEvent event) {
thebutton.setCaption ("Do not push this button again");
}
} As a user interface often has several buttons, you can differentiate between them either by comparing the |
Table of Contents
|