Here you can find the source of findChildNode(TreeModel model, Object node, String text)
static Object findChildNode(TreeModel model, Object node, String text)
//package com.java2s; // it under the terms of the GNU General Public License as published by import javax.swing.tree.TreeModel; public class Main { static Object findChildNode(TreeModel model, Object node, String text) { for (int i = 0; i < model.getChildCount(node); i++) { Object currNode = model.getChild(node, i); if (currNode.toString() != null && currNode.toString().equals(text)) return currNode; }//ww w . ja v a2 s. com return null; } }