newark wrote:Am I missing something? DefaultTreeModel just has the default implementation of clone inherited from Object. A quick scan through DefaultTreeModel's methods doesn't show any copying methods that I can see. I think the answer may be that you have to roll up your sleeves and write your own tree copying code. Shouldn't be hard.
If you have a DefaultTreeModel object, just call clone() on it. What's so complicated about that?
Grad_ wrote:1. I think you need to review how to clone:
i wrote my own clone method, but i find it still very odd, since i was taught that everything inherits from Object, but i can't call the DefaultTreeModel.clone().