Subtree « JTree « Java Swing Q&A





1. Subtree in JTree    coderanch.com

JTree has root folder invisible. It has folders as child nodes of tree called A, B, C, D. A, B can contain only leaf nodes. C, D can contain child nodes as folder and those child folders will have leaf nodes. The problem is I want C/D should be treated as single tree i.e. user can not move any leaf node ...

2. JTree SubTree    coderanch.com

Hi, Is there a way to just show part of a tree, as in a subtree. I use a JTree to create for eg: - Map |___- mapID |______M2 - simulationID |______S01 - mapDesc |______None - mapLength |______490 - mapWidth |______800 - mapScale |______Scale_25000 - JunctionList |______- Junction |______- junctionID |______- R10 |______- junctionType |______- ROAD_TYPE_JUNCTION ...... ...... |______- jConnectedTo |______- ...

3. Copy subtree in jtree    coderanch.com

Imagine, if you will, a method that makes a copy of a subtree from an existing swing.jTree filled with string objects. Having this subtree copied and saved in a DefaultMutableTreeNode variable, would allow you to paste said subtree anywhere you would like in the tree. Below is my last fruitless attempt to do the infuriating. Can anyone help me to understand ...