File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

defaultMutableTreeNode

 
Bo Ling
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic