Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Get JTree node by it's tree path  RSS feed

 
Martin Asenov
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, friends!

I examined lots of Swing classes, but couldn't find a way to get a DefaultMutableTreeNode by it's TreePath.

Can someone more familiar with Swing help me with that?

Thanks!

BR,
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try JTree#getLastSelectedPathComponent or TreePath#get getPathComponent(int index)
 
Martin Asenov
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Manesh! It worked!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!