Renaming a Tree Node

J

Jason Cavett

I am currently renaming a tree node by firing off an event when the
user right clicks on the node and clicks "Rename" on the popup menu.
This works fine. The problem is, I want to be able to check the
string before I allow the name change to take place. This is the
method that is called when I fire off the Rename event.


/**
* Rename a node in the tree.
*/
public void renameTreeNode() {
this.setEditable(true);
TreePath path = this.getSelectionPath();
this.startEditingAtPath(path);
}

Problem is, this must fire off some sort of tree event or something
that I can't figure out. So, there doesn't appear to be a way for me
to get the input that the user typed in until after the fact. Can
anybody provide any insight.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top