Java examples for Swing:JTree
restore JTree Expansion State
//package com.java2s; import java.util.StringTokenizer; import javax.swing.JTree; public class Main { /**/*from w w w. j ava2 s .com*/ * * * @param tree * @param row * @param expansionState */ public static void restoreExpansionState(JTree tree, int row, String expansionState) { StringTokenizer stok = new StringTokenizer(expansionState, ","); while (stok.hasMoreTokens()) { int token = row + Integer.parseInt(stok.nextToken()); tree.expandRow(token); } } }