public void removeNodeFromParent(MutableTreeNode node){
  MutableTreeNode parent=(MutableTreeNode)node.getParent();
  if (parent == null)   throw new IllegalArgumentException("node does not have a parent.");
  int[] childIndex=new int[1];
  Object[] removedArray=new Object[1];
  childIndex[0]=parent.getIndex(node);
  parent.remove(childIndex[0]);
  removedArray[0]=node;
  nodesWereRemoved(parent,childIndex,removedArray);
}

public void removeNodeFromParent ( MutableTreeNode node ) { MutableTreeNode parent = ( MutableTreeNode ) node . getParent ( ) ; if ( parent == null ) throw new IllegalArgumentException ( "node does not have a parent." ) ; int [ ] childIndex = new int [ 1 ] ; Object [ ] removedArray = new Object [ 1 ] ; childIndex [ 0 ] = parent . getIndex ( node ) ; parent . remove ( childIndex [ 0 ] ) ; removedArray [ 0 ] = node ; nodesWereRemoved ( parent , childIndex , removedArray ) ; }
message this to remove node from its parent . this will message nodeswereremoved to create the appropriate event . this is the preferred way to remove a node as it handles the event creation for you .
