Set the cursor position in a JTextAreaTag(s): Swing
To the top
myJTextArea.setCaretPosition(0);
myJTextArea.setCaretPosition(myJTextArea.getDocument().getLength());
myJTextArea.setCaretPosition(0);
myJTextArea.setCaretPosition(myJTextArea.getDocument().getLength());