Here you can find the source of saveExpansionState(JTree tree)
Parameter | Description |
---|---|
tree | a parameter |
public static Enumeration<TreePath> saveExpansionState(JTree tree)
//package com.java2s; //License from project: Apache License import java.util.Enumeration; import javax.swing.JTree; import javax.swing.tree.TreePath; public class Main { /**/*from ww w .j a v a 2s . co m*/ * Save the expansion state of a tree. * * @param tree * @return expanded tree path as Enumeration */ public static Enumeration<TreePath> saveExpansionState(JTree tree) { return tree.getExpandedDescendants(new TreePath(tree.getModel().getRoot())); } }