Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

How to create an interface tree and table.

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic