Hello Gentlemen,
Just to close this thread I will add the code and some of the references I used to persist the original userObject after changes in an editable tree node.
I understood that whenever you use custom objects instead of "Strings" you will need to do that.
A very good explanation about how to work with JTree can be found in the book
"Core JFC, 2nd Edition By Kim Topley" (I could find the chapter about JTree in the web...)
"To ensure that the value stored in a node after the edit has completed is an object of the correct type, it will be necessary to supply our own tree model in which the valueForPathChanged method is overridden."
In see below my TreeModel
When treeNodesChanged is called I did:
My user object ...
This worked for me, however, I am not a Java professional and probably there are better ways to do it but I am happy with the results.
Maybe this can help someone else (I took alot of time to find out that
))))