This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Dynamic JTree Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Dynamic JTree" Watch "Dynamic JTree" New topic
Author

Dynamic JTree

Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1854
Hi,
I am developing small swing application. On the left panel, there is JTable. When user selects a particular row, details of that record will be shown in jTree in right panel.
Number of nodes in JTree will vary depending on data.For example-
If data is "{ ^id^="lYc-YyMncNZDZUQvik--5NxUw/Y" ^1^(1)="Delhi" ^2^(2)="Harayana" ^3^(3)="Ind ia" }" then three nodes will be created.If data is
"{ ^id^="lYc-YyMncNZDZUQvik--5NxUw/Y" ^1^(1)="Kanpur" ^2^(2)="Uttar Pradesh" ^3^(3)="Ind ia" ^4^(4)="Asia" }"then JTree will show 4 nodes. Each node will show corresponding value of Control field.(^1^,^2^.. are control fields.)

which data structure should be used to parse this data and to populate JTree dynamically?


MH
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Dynamic JTree
 
Similar Threads
Subtree in JTree
custom icons in JTree
jTree with the TreeModel
JTree
Updating a JTree