This example describes the Basics for building the Tab Panel using GWT. The steps involved in Building the Tab Panel are described below:-
final Label label = new Label("Click the Tab below to view
Here we are declaring label. Label is a widget that contains text.
TabPanel tp = new TabPanel()
Here we are creating object of TabPanel class. TabPanel is a panel that represents a tabbed set of pages, each of which contains another widget.
HTML index = new HTML("Tab you have selected is
Creating an object of class HTML named index. HTML is a widget that can contain arbitrary HTML.
tp.add(index, "Index ")
This is a method of Tab Panel class for adding a widget to the tab panel.
By this method we are adding label to the root panel. Root panel is a panel to which all other widgets must be added. it is not created directly.
Output of the program
Posted on: October 8, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles