Java JTree restoreExpanstionState(JTree tree, int row, String expansionState)

Here you can find the source of restoreExpanstionState(JTree tree, int row, String expansionState)

Description

restore Expanstion State

License

Open Source License

Declaration

public static void restoreExpanstionState(JTree tree, int row, String expansionState) 

Method Source Code


//package com.java2s;
//License from project: MIT License 

import java.util.StringTokenizer;
import javax.swing.JTree;

public class Main {
    public static void restoreExpanstionState(JTree tree, int row, String expansionState) {
        StringTokenizer stok = new StringTokenizer(expansionState, ",");
        while (stok.hasMoreTokens()) {
            int token = row + Integer.parseInt(stok.nextToken());
            tree.expandRow(token);/*  w  ww  .  j  a va 2  s.c o  m*/
        }
    }
}

Related

  1. paint(JTree tree)
  2. pickFirstIfNone(JTree tree)
  3. printComponentTree(final JComponent fc)
  4. RemoveAll(JTree tree)
  5. repaintSelection(JTree tree)
  6. revalidateTree(java.awt.Component c)
  7. saveExpansionState(JTree tree)
  8. saveExpansionStateStrings(JTree tree)
  9. saveTreeSelection(JTree tree)