Java examples for Swing:JTree
is JTree Node Expanded
//package com.java2s; import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreePath; public class Main { public static boolean isNodeExpanded(JTree tree, DefaultMutableTreeNode node) { if (tree == null) { throw new NullPointerException("tree == null"); }// w w w.j a va 2s .c o m if (node == null) { throw new NullPointerException("node == null"); } return tree.isExpanded(new TreePath(node.getPath())); } }