Java JTree Model findChildNode(TreeModel model, Object node, String text)

Here you can find the source of findChildNode(TreeModel model, Object node, String text)

Description

find Child Node

License

Open Source License

Declaration

static Object findChildNode(TreeModel model, Object node, String text) 

Method Source Code

//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;
    }
}

Related

  1. appendTreeNodes(TreeModel model, Object node, StringBuilder builder, String indent)
  2. findChildNode(TreeModel model, Object node, String text)
  3. findTreeNode(TreeModel model, Object obj)
  4. getAllTreeNodes(TreeModel model)
  5. getTreeIndents(TreeModel in)
  6. getTreeModelSize(TreeModel in)