How to Create Independent copies of a TreeModel
I have a Jtree component and i need to create a copy of it's model so that i can edit it individually, So I use the following code :
TreeModel PreviewModel = this.XMLtree.getModel();
Where XMLtree a Jtree component.
My problem is that, when a change is made to the PreviewModel, the same change is applied to XMLtree model as well, It's like i created a pointer to the XMLtree model and not a new TreeModel.
So, can anyone explain to me how to create an independent exact copy of the TreeModel ?
I'm in desperate need of.... HEEEEEEELPPPPPPPP !