Java JTree Expand expandAllNodes(final JTree tree)

Here you can find the source of expandAllNodes(final JTree tree)

Description

Expands all nodes in the specified tree.

License

BSD License

Parameter

Parameter Description
tree The tree.

Declaration

public static void expandAllNodes(final JTree tree) 

Method Source Code

//package com.java2s;
/*/*from  www  . j  av  a  2 s .co  m*/
 * 09/08/2005
 *
 * UIUtil.java - Utility methods for org.fife.ui classes.
 * Copyright (C) 2005 Robert Futrell
 * http://fifesoft.com/rtext
 * Licensed under a modified BSD license.
 * See the included license file for details.
 */

import javax.swing.JTree;

public class Main {
    /**
     * Expands all nodes in the specified tree.
     *
     * @param tree The tree.
     */
    public static void expandAllNodes(final JTree tree) {
        // Do separately for nested panels.
        int j = 0;
        while (j < tree.getRowCount()) {
            tree.expandRow(j++);
        }
    }
}

Related

  1. expandAll(JTree tree)
  2. expandAll(JTree tree)
  3. expandAll(JTree tree, boolean expand)
  4. expandAll(JTree tree, boolean expand)
  5. expandAllNode(JTree tree, TreePath parent)
  6. expandAllNodes(JTree tree)
  7. expandAllNodes(JTree tree)
  8. expandAllNodes(JTree tree, int startingIndex, int rowCount)
  9. expandAllNodes(JTree tree, int startingIndex, int rowCount)