Multiple components as one node in JTree
Hi there,
I want to customize the nodes of a JTree. I've seen lots and lots of examples how to modify JTables and how to add checkboxes to JTrees (incredibly popular as it seems) but that's not enough for my problem. Getting a model to represent the structure of my data is not hard by deriving a custom class from DefaultMutableTreeNode but once I connect the model to the JTree all it renders is the custom class' toString() method which I can of course override.
Say every node in the tree (rather in the model) relates to one custom object called TCustomRow. Visually a TCustomRow shall be represented by (from left to right) a button, a label and a textfield. Actually I need more components then that but I want to understand how to do it so I can extend it any time I need to.
I've read through some related material and it seems as if I had to create my own cell renderer and my own cell editor which kind of scares me. Is there another - more intuitive - way ?
Thanks in advance,
Amnu