aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Dynamic JTree Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Dynamic JTree" Watch "Dynamic JTree" New topic
Author

Dynamic JTree

Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
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://aspose.com/file-tools
 
subject: Dynamic JTree