How to set AUTO-SCROLLING of JTextArea in Java GUI?

When using JDK1.4.2 (or earlier) the most common suggestion you will find in the forums is to use code like the following: textArea.append(…); textArea.setCaretPosition(textArea.getDocument().getLength()); However, I have just noticed that in JDK5 this issue has actually been resolved by an API change. You can now control this behaviour by setting a property on the DefaultCaret … Read more