Jump to Real's How-to Main page

Set the cursor position in a JTextArea

To the top
myJTextArea.setCaretPosition(0);
To the end
myJTextArea.setCaretPosition(myJTextArea.getDocument().getLength());

If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]