Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JScrollPane auto scroll question

 
David Casta´┐Żeda
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I really find this in google but I couldn't find and answer....

I have a JScrollPane with internal panels, which have thier components, the proble is that if I get to one of this components by pressing "tab" and the component wasn't visible the JScrollPane doesn't do autoscroll to show the selected component.

Any ideas, thanks a lot.


David Casta´┐Żeda
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could try getting the bounds of the (tabbed–to) component with 'getBounds' and then call 'scrollRectToVisible(bounds)' on its parent. You may have to move the 'scrollRectToVisible' call to a parent higher up in the hierarchy, somewhere between the components parent and the view (child) component of the scrollPane. Depends on how you've put things together.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic