Example usage for javax.swing JTree JTree

List of usage examples for javax.swing JTree JTree

Introduction

In this page you can find the example usage for javax.swing JTree JTree.

Prototype

public JTree(TreeNode root, boolean asksAllowsChildren) 

Source Link

Document

Returns a JTree with the specified TreeNode as its root, which displays the root node and which decides whether a node is a leaf node in the specified manner.

Usage

From source file:it.unibas.spicygui.vista.ProjectTreeTopComponent.java

private void myInitComponents() {
    this.setLayout(new BorderLayout());
    this.scrollPane = new JScrollPane();
    scrollPane.setPreferredSize(new DimensionUIResource(100, this.getHeight()));
    this.setPreferredSize(new Dimension(100, this.getHeight()));
    this.jTree = new JTree(null, false);
    new TreeDragSource(jTree, DnDConstants.ACTION_COPY_OR_MOVE);
    this.jTree.setDragEnabled(true);
    //        new TreeDropTarget(tree);
    this.scrollPane.setViewportView(jTree);
    this.add(this.scrollPane, BorderLayout.CENTER);
}