File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic JTree

Arjun Shastry
Ranch Hand
Posts: 1893
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic