Javatpoint Logo
Javatpoint Logo

GWT DialogBox

GWT DialogBox has a caption area at the top and can be dragged by the user.GWT DialogBox, calls to PopupPanel.setWidth(String) and PopupPanel.setHeight(String) will set the width and height of the dialog box.

GWT DialogBox Class Declaration

Let's see the declaration of com.google.gwt.user.client.ui.DialogBox

GWT DialogBox Nested Classes

Class Description
DialogBox.Caption It is a set of characteristic interfaces supported by the DialogBox caption.
DialogBox.CaptionImpl It is a default implementation of Caption.

GWT DialogBox Constructors

Constructor Description
DialogBox() It creates an empty dialog box.
DialogBox(boolean autoHide) It creates an empty dialog box specifying its "auto-hide" property.
DialogBox(boolean autoHide, boolean modal) It creates an empty dialog box specifying its "auto-hide" and "modal" properties.
DialogBox(boolean autoHide, boolean modal, DialogBox.Caption captionWidget) It creates an empty dialog box specifying its "auto-hide", "modal" properties and an implementation a custom DialogBox.Caption.

GWT DialogBox Common Methods

Modifier and Types Method Description
protected void beginDragging(MouseDownEvent event) It is called on mouse down in the caption area, begins the dragging loop by turning on event capture.
protected void doAttachChildren() If a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and call Widget.onAttach() for each of its child widgets.
protected void doDetachChildren() If a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and call Widget.onDetach() for each of its child widgets.
void hide(boolean autoClosed) It hides the popup and detaches it from the page.
void onBrowserEvent(Event event) It is called whenever a browser event is received.
protected void onPreviewNativeEvent(Event.NativePreviewEvent event) It creates the preview.
void setHTML(SafeHtml html) It sets the html string inside the caption by calling its setHTML(SafeHtml) method.
void setHTML(java.lang.String html) It sets the html string inside the caption by calling its setHTML(SafeHtml) method.
void setText(java.lang.String text) It sets the text inside the caption by calling its setText(String) method.
void show() It shows the popup and attach it to the page.

GWT DialogBox Example 1

//SampleDialogBox1.java

Output:

GWT DialogBox

GWT DialogBox Example 2

//SampleDialogBox2.java

Output:

GWT DialogBox
Next TopicGWT DateBox





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA