存储状态/jtree的扩展节点以恢复状态 [英] store state/expanded nodes of a jtree for restoring state

查看:114
本文介绍了存储状态/jtree的扩展节点以恢复状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JTree.

I am working with JTree.

我想知道什么是最好的方法,即知道在JTree中扩展哪些节点以保存其状态(即保存所有扩展路径).这样,如果我调用model.reload(),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.

推荐答案

Santhosh Kumar是我的Swing Hacks入门人员之一.

Santhosh Kumar is one of my go-to guys for Swing Hacks.

答案: http://www.javalobby.org/java/forums/t19857. html

这篇关于存储状态/jtree的扩展节点以恢复状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆