This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Initially expanded JTree? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Initially expanded JTree?" Watch "Initially expanded JTree?" New topic

Initially expanded JTree?

Craig Snowbarger
Ranch Hand

Joined: Mar 07, 2001
Posts: 38
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?
Craig Snowbarger
zoe goddard
Ranch Hand

Joined: Dec 12, 2000
Posts: 74
How about something like this?
TreePath path = tree.getPathForRow(row);
I agree. Here's the link:
subject: Initially expanded JTree?
It's not a secret anymore!