More Tutorials| Bioinformatics| Open Source| Photoshop| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Creating Tab Panel using GWT 
 

This example describes the Basics for building the Tab Panel using GWT.

 

Creating Tab Panel using GWT

                         

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 content")
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 Index.")
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.

RootPanel.get().add(tp)
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.

TabPanelEx.java

package org.yournamehere.client;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TabPanel;
import com.google.gwt.user.client.ui.RootPanel;

public class TabPanelEx {

    public void onModuleLoad() {
        final Label label = new Label("Click the Tab below to view content");
        final Label label1 = new Label("                                   ");
        
        TabPanel tp = new TabPanel();
        tp.setWidth("200px");
        HTML index1 = new HTML("");
        HTML index = new HTML("Tab you have selected is Index.");
        tp.add(index, "Index         ");

        HTML homeText = new HTML("Tab you have selected is Home.");
        tp.add(homeText, "   Home  ");

        HTML moreInfo = new HTML("Tab you have selected is MoreInfo.");
        tp.add(moreInfo, "      MoreInfo  ");

        tp.selectTab(0);
        RootPanel.get().add(label);
        RootPanel.get().add(label1);
        RootPanel.get().add(tp);

    }
}

Main.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<module>
  <inherits name="com.google.gwt.user.User"/>
  <entry-point class="org.yournamehere.client.TabPanelEx"/>
</module>

Output of the program

Download sourcecode

                         

» View all related tutorials
Related Tags: c xml file server data gwt vi using this ie example exam e il des trie from in ml m

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.