Java JTree Expand expand(JTree tree, int startingIndex, int rowCount)

Here you can find the source of expand(JTree tree, int startingIndex, int rowCount)

Description

Stolen from http://stackoverflow.com/a/19935987/5620200

License

Open Source License

Parameter

Parameter Description
tree a parameter
startingIndex a parameter
rowCount a parameter

Declaration

public static void expand(JTree tree, int startingIndex, int rowCount) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.JTree;

public class Main {
    /**//from w  ww. ja va2s.  co  m
     * Stolen from http://stackoverflow.com/a/19935987/5620200
     * @param tree
     * @param startingIndex
     * @param rowCount
     */
    public static void expand(JTree tree, int startingIndex, int rowCount) {
        for (int i = startingIndex; i < rowCount; ++i) {
            tree.expandRow(i);
        }

        if (tree.getRowCount() != rowCount) {
            expand(tree, rowCount, tree.getRowCount());
        }
    }
}

Related

  1. autoExpand(JTree tree, TreePath path, int maxLines, int maxChildToExpand, boolean dontExpandToLeafs)
  2. buildTreePath(JTree tree, TreePath parent, String[] nodes, int startdepth, boolean expandable)
  3. expand(JTree tree, int depth)
  4. expand(JTree tree, int level)
  5. expandAll(final JTree tree, final TreePath parent, final boolean expand)
  6. expandAll(JTree jTree)
  7. expandAll(JTree rightTree)
  8. expandAll(JTree t)