Java JTree Create createTree()

Here you can find the source of createTree()

Description

create Tree

License

Open Source License

Declaration

public static JTree createTree() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;

public class Main {
    public static JTree createTree() {
        DefaultMutableTreeNode top = new DefaultMutableTreeNode("home");
        top.add(new DefaultMutableTreeNode("Alice"));
        top.add(new DefaultMutableTreeNode("Bob"));
        top.add(new DefaultMutableTreeNode("Eve"));
        JTree tree = new JTree(top);
        return tree;
    }/*from  w w w .j a v a2s.co m*/
}

Related

  1. createEnumeration(String className, TreeNode root)
  2. createSimpleTreeCellRenderer(ImageIcon icon)
  3. createTree(JTree jTree1, String[] leaves)
  4. createTreeNode(String text, int depth)