Javatpoint Logo
Javatpoint Logo

GWT RootPanel

GWT RootPanel is the starting or the top most panel to which all other Widgets are attached. To access the root panel in the application, we can use this syntax: RootPanel.get().

This panel consists of html pages. Root panel returns the singleton value that binds the GWT application. For control modification in web-app we can change the syntax as follows: RootPanel.get(String argument).

GWT RootPanel Class Declaration

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

GWT RootPanel methods

Modifier and Types Method Description
void clear(boolean clearDom)) It removes all the Dom elements that can cause issues with other elements in page.
static void detachNow(Widget widget) It marks a widget as detached and removes it from the detach list.
static void detachOnWindowClose(Widget widget) It adds a widget to detach list.
static RootPanel get(java.lang.String id) It gets the RootPanel associated with browser element
static Element getBodyElement() It is a simple method for gettin document body element.
static boolean isInDetachList(Widget widget) It determines the given widget is in detach list.

GWT RootPanel Example

//SampleRootPanel.java

Output:

GWT RootPanel
Next TopicGWT FlowPanel




Help Others, Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA