List of usage examples for javax.swing JTree JTree
public JTree(TreeNode root, boolean asksAllowsChildren)
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. 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); }