Java Swing: how do I define how a JTree displays the "user object"?
Posted
by java.is.for.desktop
on Stack Overflow
See other posts from Stack Overflow
or by java.is.for.desktop
Published on 2010-04-04T16:51:34Z
Indexed on
2010/04/04
17:03 UTC
Read the original article
Hit count: 313
Hello, everyone!
When using a JTree, a "user object" of a DefaultMutableTreeNode can be set. This can be of any kind, but to display it, its toString() value is used. This is not what I need.
How can I change the way a user object is displayed?
NOTE: My user object has to be something different than a String to be able to maintain mapping between the tree and the user objects.
© Stack Overflow or respective owner