super class clone question

I have a bunch of DefaultMutableTreeNodes already created and I

want to convert them all to myTreeNode objects which extends

DefaultMutableTreeNode. Is there an easy way for assigning the super class of myClass which is DefaultMutableTreeNode.

I know this doesn't work but what I want to do is something like

setting the super class= passed in DMTN.

I know I could create the original node1,node2 as myTreeNodes instead but these nodes are created in a bunch of different places and I would prefer not having to modify that code.

node1 = new DefaultMutableTreeNode();

node2 = new DefaultMutableTreeNode();

new myTreeNode(node1);

class myTreeNode extends DefaultMutableTreeNode{

boolean isSelected;

public myTreeNode(DefaultMutable TreeNode node){

super = node.clone();}

}

[866 byte] By [Doug_99a] at [2007-11-27 6:10:27]
# 1
Traverse your tree model and replace its data with your own tree nodes?
thomas.behra at 2007-7-12 17:15:50 > top of Java-index,Java Essentials,Java Programming...