sub child in tree UI

public class TodoScreen extends VerticalLayout implements View {
private static final long serialVersionUID = -7005445336418613611L;

public TodoScreen () {
      Label label = new Label ("Hello, Todo Screen!");
      label.addStyleName (ValoTheme.LABEL_H1);
      addComponent (label);
      setComponentAlignment (label, Alignment.TOP_CENTER);

groupCategories = new Object
new Object{“Group Categories”, “Language”, “Products”, “Roles”},new Object
{“Group”, “Language1”, “Products1”, “Roles1”}};

      Tree tree = new Tree();
      /* Add groupCategories as root items in the tree. */
      for (int i=0; i<groupCategories.length; i++) {
          String categories = (String) (groupCategories[i]


          if (groupCategories[i]

.length == 1) {
// The categories has no item(s) so make it a leaf.
tree.setChildrenAllowed(categories, true);
} else {
// Add children (item) under the categories.
for (int j=1; j<groupCategories[i]
.length; j++) {
String item = (String) groupCategories[i]

                  // Add the item as a regular item.
                  // Set it to be a child.
                  tree.setParent(item, categories);
                  // Make the moons look like leaves.
                  tree.setChildrenAllowed(item, false);
              // Expand the subtree.


i want to add subroot to languages, how do i implement that?

groupCategories = new Object
new Object{“Group Categories”, "
", “Products”, “Roles”},new Object{“Group”, “Language1”, “Products1”, “Roles1”}};


Sorry, but I don’t really understand what you want to accomplish. And the code isn’t runnable. You add items via tree.addItem(id). Then you can set its parent with tree.setParent(childID, parentID). So if you want to add something “underneath” Languages, you can use setParent(childID, “Languages”).