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

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Creating Tree Structure using GWT 
 

This example describes the Basics for building the Tree Structure using GWT.

 

Creating Tree Structure using GWT

                         

This example describes the Basics for building the Tree Structure using GWT. The steps involved in Building the Tree Structure 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.

Tree Item root = new TreeItem("Vowels")
Creating tree item i.e. creating root for tree.TreeItem is a class. In this an item can be contained within a tree.

root.addItem("a")
This is the method for adding an item to the root of the tree. Here we are adding a to the tree name "root".

Tree t = new Tree()
Tree is a class and it contains a hierarchy of tree items that user can open and close.

Treeexample.java

package org.yournamehere.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TreeItem;
import com.google.gwt.user.client.ui.Tree;

public class Treeexample implements EntryPoint {
final Label label = new Label("Click the Node to view Tree structure");
public void onModuleLoad() {
    TreeItem root = new TreeItem("Vowels");
    root.addItem("a");
    root.addItem("e");
    root.addItem("i");
    root.addItem("o");
    root.addItem("u");
   TreeItem root1 = new TreeItem("Digits")
    root1.addItem("1");
    root1.addItem("2");
    root1.addItem("3");
    root1.addItem("4");
    root1.addItem("5");

    TreeItem item = new TreeItem();
    root.addItem(item);
    root1.addItem(item);
    Tree t = new Tree();
    t.addItem(root);
    t.addItem(root1);
    RootPanel.get().add(label);
    RootPanel.get().add(t);
  }
}

Main.gwt.xml

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

Output of the program

Download Source code

                         

» 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.