store state/expanded nodes of a jtree for restoring state
问题 I am working with JTree. I would like to know what is best the way to know which nodes are expanded in a JTree so as to save its state (i.e. save all expanded paths). So that if I call model.reload() the Jtree would not stay collapsed, but I will be able to restore its original state to the user, i.e., all expanded nodes will be expanded. 回答1: Santhosh Kumar is one of my go-to guys for Swing Hacks. Answer: http://www.javalobby.org/java/forums/t19857.html 回答2: You need to store the TreePaths