• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTree: Selected moved to top

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JTree has a scrollPathToVisible() method. It makes sure all the path components in path are expanded (except for the last path component) and scrolls so that the node identified by the path is displayed.
How do I get the "node identified by the path" to display at the top of the JScrollPane?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!
I've the same problem: Any new ideas on this?
Thanks!
J.F.
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
maybe there is a better way, but here is my
thought:

getRowBounds return a Rectangle which is used to draw the row. getLocation return the position relative to the JTree. So, set the view position to that location will do what you want.
good lucky
kawaii
[ February 20, 2002: Message edited by: kawaii desu ]
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java Foolxxx,

Please re-register with a user name that follows the Official JavaRanch User Name Guidelines. Your username is required not to be an obviously fake name...

Thanks,
-Nate
reply
    Bookmark Topic Watch Topic
  • New Topic