Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes How to create an interface tree and table. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to create an interface tree and table." Watch "How to create an interface tree and table." New topic
Author

How to create an interface tree and table.

ajay karanam
Greenhorn

Joined: Oct 20, 2008
Posts: 2
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

Joined: Jul 26, 2007
Posts: 10172
    
    8

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 ]

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Pavan Kumar Srinivasan
Greenhorn

Joined: Sep 17, 2008
Posts: 27
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

Joined: Oct 20, 2008
Posts: 2
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

Joined: Jul 26, 2007
Posts: 10172
    
    8

..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?
 
Consider Paul's rocket mass heater.
 
subject: How to create an interface tree and table.
 
Similar Threads
Regarding Serializable
How to create horizontal treetable
WA#2 word association
Type of tree in DOM parser
Jtable customization