Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Preserving selections in JTree  RSS feed

 
Kevin Jaffe
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With JTree, when a node's descendant is selected (i.e. highlighted),
and then the node is "closed", the descendant becomes deselected and
the node itself becomes selected. If the node is then re-opened, it
remains selected, while the formerly selected descendant remains
unselected. In other word, JTree forgets that a descendant is
selected when an ancestor is closed.
Is there any way to get JTree to remember all the selected nodes, even
while ancestor nodes are closed?
Thanks!
KJ
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!