
public class ButtonExample implements EntryPoint {
public void onModuleLoad() {
// Make a new button that does something when you click it.
Button b = new Button("Jump!", new ClickListener() {
public void onClick(Widget sender) {
Window.alert("How high?");
}
});
// Add it to the root panel.
RootPanel.get().add(b);
}
}
| Button() | Creates a button with no caption. |
| Button(String) | Creates a button with the given HTML caption. |
| Button(String, ClickListener) | Creates a button with the given HTML caption and click listener. |
| click() | Programmatic equivalent of the user clicking the button. |