Demos and Usage of javax.swing.tree.TreeNode.isLeaf()


   1:       Object node = tree.getLastSelectedPathComponent();
   2:       if ((node != null) &&  (node instanceof TreeNode)) {
   3:         ...
   4:         TreeNode treeNode = (TreeNode)node;
   5:         ...
   6:         returnValue = treeNode.isLeaf();
   7:       }

View Full Code Here
   1: import javax.swing.tree.TreeModel;
   2: import javax.swing.tree.TreeNode;
   3: import javax.swing.tree.TreePath;
   4:         ...
   5:   public int getChildCount(Object parent) {
   6:     TreeNode node = (TreeNode)parent;
   7:     return node.getChildCount();
   8:         ...
   9:     TreeNode node = (TreeNode)obj;
  10:     return node.isLeaf();
  11:   }

View Full Code Here