model.insertNodeInto(newChildNode, newNode, newNode.getChildCount()); copyChildren(oldChildNode, newChildNode);
model.insertNodeInto(newChildNode, parentNode, insertionIndex++); copyChildren(oldChildNode, parentNode, insertionIndex);
  private void copyChildren(DefaultMutableTreeNode oldNode,                            DefaultMutableTreeNode newNode) {    DefaultTreeModel model = (DefaultTreeModel)getModel();    int nChildren = oldNode.getChildCount();    for (int i=0; i < nChildren; i++) {      DefaultMutableTreeNode oldChildNode =         (DefaultMutableTreeNode)oldNode.getChildAt(i);      CommunityTreeObject cto =         (CommunityTreeObject)oldChildNode.getUserObject();      CommunityTreeObject newCTO = cto.copy();      DefaultMutableTreeNode newChildNode =        new DefaultMutableTreeNode(newCTO, newCTO.allowsChildren());      if (isDuplicate(newChildNode, newNode) ||          isInCommunity(newChildNode, newNode))        continue;      model.insertNodeInto(newChildNode, newNode, newNode.getChildCount());      copyChildren(oldChildNode, newChildNode);    }  }