Not Just Paranoid

Another site by Pete Maynard

JScrollPane back to top

If you want to make your JScrollPane return to the top once you have enter some text, try this:

myTextArea.setCaretPosition( 0 )

It places the curser back to zero and in turn makes the JScrollPane go back to the top. Worked for me, hope this helps someone.

1 May 2009 | Tags ( Java Programming )

Website Last Updated on 13 Oct 2020 (CC BY-SA 4.0)

This site uses JQuery and nanogallery2 hosted by jsdelivr.net
for the Flickr photo feed and GoatCounter for user insights.