This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JScrollPane auto scroll question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JScrollPane auto scroll question" Watch "JScrollPane auto scroll question" New topic
Author

JScrollPane auto scroll question

David Casta�eda
Greenhorn

Joined: Feb 13, 2005
Posts: 1
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

Joined: Jan 14, 2004
Posts: 1535
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JScrollPane auto scroll question
 
Similar Threads
JScrollPane
JscrollPane
focus moved, JScrollPane scroll to new component question.
limiting # of JList rows in a JScrollPane
Printing hardcopy - multiple copies