• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create an interface tree and table.

 
ajay karanam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
This is my first post.
Please provide me some tips or an idea to implement an interface between a tree structure and a table contents.
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ajay,
Welcome to the ranch. We are happy to have you here.

What do you mean by "interface between a tree and a table"
Are you planning to display the same data in a JTree as well as a JTable?
[ October 20, 2008: Message edited by: Maneesh Godbole ]
 
Pavan Kumar Srinivasan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are looking for something with a tree like structure with each node's properties being displayed like a table... i would suggest have a look at swingx TreeTable component.

[ October 20, 2008: Message edited by: Pavan Kumar Srinivasan ]
[ October 20, 2008: Message edited by: Pavan Kumar Srinivasan ]
 
ajay karanam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying

"interface between tree and table" means if the user clicks on the particular node of the tree(left pane) then corresponding table should be displayed on (right pane).
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
..if the user clicks on the particular node of the tree(left pane) then corresponding table should be displayed on (right pane)


This should not be difficult enough to build.
1) Create a custom object.
2) Wrap it inside a DefaultMutableTreeNode and build a JTree from it.
3) Figure out which node the user has selected
4) Extract the custom object from the selected node
5) Pass the object to the table model and ask it to update the table.

Makes sense?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic