Results 1 to 3 of 3
Thread: How to autoscroll a JScrollPane
- 03-10-2011, 03:13 AM #1
How to autoscroll a JScrollPane
I have done a bit of research and all the solutions I have found deal with JTextArea and scrolling to the bottom. My situation is different. I have a stack of JTextfields vertically aligned. What I want is when you are in the last visible text field and you hit tab to the next one, the scrollpane will automatically scroll up to make that text field visible. Is this possible?
- 03-10-2011, 05:23 AM #2
Assuming the JTextFields are contained in a JPanel (panel), something like
in a FocusListener#focusGained, attached to each text field.Java Code:panel.scrollRectToVisible(((Component) e.getSource()).getBounds());
db
- 03-10-2011, 09:32 PM #3
Similar Threads
-
Autoscroll website
By Eliteoomph in forum New To JavaReplies: 2Last Post: 02-09-2011, 09:33 PM -
Help with jScrollPane
By weikang in forum SWT / JFaceReplies: 1Last Post: 02-04-2011, 03:30 AM -
Chat window autoscroll lockes scrollbar at buttom
By ZacK.YoveL in forum AWT / SwingReplies: 2Last Post: 06-25-2010, 11:19 PM -
dragging the row header autoscroll
By Allgorythm in forum New To JavaReplies: 6Last Post: 02-15-2010, 05:10 AM -
jscrollpane
By kaemonsaionji in forum New To JavaReplies: 3Last Post: 02-25-2009, 08:39 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks