How can we display multiple fields of a object in DefaultTreeCellRenderer. Please let me know if there is any tutorial. I have tried this tutorial but it isn't talked about displaying the object data in many column.
Asked
Active
Viewed 2,996 times
3
-
JTrees display one column. JTables display more than one column. You can have a popup display the rest of the information for a JTree column. – Gilbert Le Blanc May 06 '13 at 19:34
-
The `DefaultMutableTreeNode` just uses the `toString()` method of the `Object` passed into its contructor, so you could extract the fields there. Alternatively, there are such things as `TreeTable`s, but not in the JDK so you'd have to find one. – kuporific May 06 '13 at 19:53
-
@kuporfic I have tried that method but I am not able to put some space between the two column. – Ashish May 06 '13 at 23:18
2 Answers
4
After some research I have found the tutorial which I was looking. Here is the link
-
What in this lengthy, German-language article did you find sufficiently helpful to warrant a link-only answer? – trashgod May 07 '13 at 01:28
-
@trashgod I used google translate to change it to english and I could not find any other answer. If you have any suggestions please let me know. – Ashish May 07 '13 at 02:37
-
-
-
On closer examination, I see an informative class diagram in the linked article. – trashgod May 07 '13 at 10:54