Here you can find the source of RemoveChildren(DefaultMutableTreeNode node)
public static void RemoveChildren(DefaultMutableTreeNode node)
//package com.java2s; /**/*from www. j av a 2 s . c o m*/ * CEDP: Computer Evaluator for Dependability and Performance * This file is distributed under the University of Illinois Open Source * License. See LICENSE.TXT for details. */ import javax.swing.tree.DefaultMutableTreeNode; public class Main { public static void RemoveChildren(DefaultMutableTreeNode node) { while (node.getChildCount() > 0) { RemoveChildren((DefaultMutableTreeNode) node.getFirstChild()); } //System.out.println("" + node); node.removeFromParent(); } }