aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes scrolling a JScrollpane with TAB-Key Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "scrolling a JScrollpane with TAB-Key" Watch "scrolling a JScrollpane with TAB-Key" New topic
Author

scrolling a JScrollpane with TAB-Key

jay cheung
Greenhorn

Joined: Dec 30, 2004
Posts: 2
I have a UI with buttons and textfield on it.

With the mouse I can scroll the JScrollPane but I can not force
the JScrollPane to scroll if I press the TAB-Key.

How can I force the JScrollPane to scroll to the next JTextField
if I press the TAB-Key?

Thx!
jay cheung
Greenhorn

Joined: Dec 30, 2004
Posts: 2
any1 know how to do this?
thx a lot!
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
perhaps focus listeners for the textfields
and in focusGained() you have scrollRectToVisible()
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: scrolling a JScrollpane with TAB-Key
 
Similar Threads
Pressing a key from the code
How to catch key event in JTable
Help with JScrollPane
Jlist in a JDialog losing focus
Tabbing into a Scroll List