Could someone help me with this problem? I have a JTextArea inside a JScrollPane so that I can scroll the text. My program reads a files and populated the textarea. When it is done, the textarea is scrolled all the way down. How can I scroll it all the way up programmatically? Thanks, Arsalan ------------------
HI, You could set the JTextArea caret position to 0. The top ... textArea.setCaretPosition( 0 ); That should make the scrollbars back to top of textarea. Regards, Manfred.
Hi Manfred, That worked. Thanks for your help. Arsalan
Originally posted by Manfred Leonhardt: HI, You could set the JTextArea caret position to 0. The top ... textArea.setCaretPosition( 0 ); That should make the scrollbars back to top of textarea. Regards, Manfred.
Remember to always leap before you look. But always take the time to smell the tiny ads: