我有一棵树和一个到它的一个节点的 TreePath。如何以编程方式选择该节点? JTree 对象的 setSelectionPath 单独工作吗?
最佳答案
是的。来自 Java 文档
If any component of the path is hidden (under a collapsed node), and getExpandsSelectedPaths is true it is exposed (made viewable).
关于Java树节点选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1802014/