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);
  }
}

