
public class DialogBoxExample implements EntryPoint, ClickListener {
private static class MyDialog extends DialogBox {
public MyDialog() {
// Set the dialog box's caption.
setText("My First Dialog");
// DialogBox is a SimplePanel, so you have to set it's widget property to
// whatever you want its contents to be.
setWidget(new Label("Click outside of this popup to close it"));
}
}
public void onModuleLoad() {
Button b = new Button("Click me");
b.addClickListener(this);
RootPanel.get().add(b);
}
public void onClick(Widget sender) {
// Instantiate the dialog box and show it.
new MyDialog().show();
}
}
| DialogBox() | Creates an empty dialog box. |
| getHTML() | Gets this object's contents as HTML. |
| getText() | Gets this object's text. |
| onMouseDown(Widget, int, int) | Fired when the user depresses the mouse button over a widget. |
| onMouseEnter(Widget) | Fired when the mouse enters a widget's area. |
| onMouseLeave(Widget) | Fired when the mouse leaves a widget's area. |
| onMouseMove(Widget, int, int) | Fired when the user moves the mouse over a widget. |
| onMouseUp(Widget, int, int) | Fired when the user releases the mouse button over a widget. |
| remove(Widget) | |
| setHTML(String) | Sets this object's contents via HTML. |
| setText(String) | Sets this object's text. |
| setWidget(Widget) | Sets this panel's widget. |
null will clear the panel)