Here you can find the source of isNodeAsStrChild(DefaultMutableTreeNode parent, String child)
public static boolean isNodeAsStrChild(DefaultMutableTreeNode parent, String child)
//package com.java2s; //License from project: Open Source License import javax.swing.tree.DefaultMutableTreeNode; public class Main { public static boolean isNodeAsStrChild(DefaultMutableTreeNode parent, String child) { for (int i = 0; i < parent.getChildCount(); i++) { if (((DefaultMutableTreeNode) parent.getChildAt(i)).getUserObject().toString().equals(child)) { return true; }//from w w w.j ava 2s.c o m } return false; } }