I have a JTree with custom tree nodes and I need it to fire an event after tree note title has been edited. So far I have this:
tree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
MyTreeNode node = (MyTreeNode) tree.getLastSelectedPathComponent();
if (node == null) {
return;
}
//insert the new title in database
});
But, this fires everytime the selection is changed. I need it to fire when the node title value has changed so I can update it in the database. Any help?