Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JTree: Rename a Node using an ActionListener

fcojavierperezSep 16 2009 — edited Sep 17 2009
Hi all,

I have read here many and many posts about renaming JTree nodes but... no one of them has helped me. So despite I may be very boring... I will ask about that again.

The situation is very simple. I have a SAVE button that, when I press it, the name of a node in my JTree has to change.

And the question again, is...

How can I do to change the name of a node in a JTree?

Of course, I know that stupid things like node.toString() = newname are not the solution.

What could I do? How is posible that something that should be so simple is actually not??? How is posible that MutableTreeNode has not a field called "name"??

Im sorry... I feel a bit frustrated now after fighting with this thing for hours...

Thanks for your help,

Fran.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 15 2009
Added on Sep 16 2009
5 comments
1,494 views