This example describes the Basics for creating composite widgets using GWT. The steps involved in Building the Composite widgets are described below:-
final Label label = new Label("Click the Node to view Tree
structure")
Here we are declaring label. Label is a widget that
contains text.
private TextBox tb = new TextBox();
Declaring a new TextBox as tb.
private CheckBox cb = new CheckBox();
Declaring a new CheckBox as cb.
VerticalPanel panel = new VerticalPanel()
Creating a Vertical panel named as panel.
panel.add(cb)
This is the method of the panel class for adding checkbox to the panel.
RootPanel.get().add(label1)
By this method we are adding label to the
rootpanel.Root panel is a panel to which all other widgets must be added.
it is not created directly.
Compositewidgetex.java
|
Main.gwt.xml
<?xml version="1.0" encoding="UTF-8"?>
|
Output of the program :
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Creating Composite Widgets using GWT
Post your Comment