I use DefaultMutableTreeNode to build tree. How do I change the Node name (just the name is changed, the tree structure remains the same) after building the tree.
Joined: May 29, 2003
It's been a while since I've done JTree stuff, but as I remember it, you use the setUserObject method, passing in an object which will set the caption by caling the toString method on the object. In most cases, I would imagine you would pass a string to setUserObject, or at least an object whose toString method is overridden to provide a useful caption to the tree nodes.