This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Initially expanded JTree?

 
Craig Snowbarger
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to set my JTree to be fully expanded at runtime. I've found the method, setExpandedState(path, state), but I can't figure out how to retrieve the path with out manually selecting it. Any ideas?
Regards,
Craig Snowbarger
 
zoe goddard
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about something like this?
TreePath path = tree.getPathForRow(row);
tree.expandPath(path);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic