How can I move the current scroll view of a JTextArea down so that the caret appears at the top of the JTextArea? Thanks.
You can do:
Point pt = textArea.getCaret().getMagicCaretPosition();
Rectangle rect = new Rect(pt, new Dimension(1, 10));
textArea.scrollRectToVisible(rect);
One can also use the getDocument
for a better selection.