Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Preserving selections in JTree

Kevin Jaffe
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?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic