dcsimg

In jdk1.3rc1, after calling JTextArea's setText() method, the JTextArea (inside a JScrollPane) scrolls to the end of the text. Is there a way to force the JTextArea to scroll all the way to the top after calling setText()? (It appears this behavior is new to 1.3...)

Curtis Hatter

Use

myTextArea.setCaretPosition(0);

That should automatically scroll the text area back up top.