TreeBranch implements the List<TreeNode> interface, so there are defined the "add", "insert", "update" methods. So, if you create a parent TreeBranch and a child node (TreeBranch or TreeNode), then use the "add" method on the parent to add the child to it.
Roger Whitcomb | Architect, Engineering | [email protected]| Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 | USA <http://www.google.com/maps?f=q&hl=en&geocode=&q=500+Arguello+Street+%7C +Suite+200+%7C+Redwood+City+%7C+CA+%7C+94063+%7C+USA+&sll=37.0625,-95.67 7068&sspn=50.557552,73.037109&ie=UTF8&t=h&z=16&iwloc=addr> | +1 650-587-5596 | fax: +1 650-587-5550 From: Yunlong Zhao [mailto:[email protected]] Sent: Friday, August 06, 2010 2:05 PM To: [email protected] Subject: How to make TreeBranch a parent of another TreeBranch in Java Hi All, Is there a way to generate a TreeView which has nested TreeBranch dynamically in Java like the following static TreeView? <TreeBranch xmlns="org.apache.pivot.wtk.content"> <TreeBranch text="Branch1" icon="images/gear-green.gif"> <TreeBranch text="Branch2" icon="images/folder-open.png" > <TreeNode text="Tree node" icon="images/bridge.gif"/> </TreeBranch> </TreeBranch> </TreeBranch> Thanks, Yunlong
