I\'ve created a JFrame, with a JTextArea. I would like to scroll down the textarea automatically, after each append. How should I manage it?
I\'ve tried log.se
log.se
there are two ways (but JTextArea must be placed in JScrollPane)
a) set Caret (correct of ways)
e.g.
DefaultCaret caret = (DefaultCaret) log.getCaret(); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
b) moving with JScrollBar (from JScrollPane) to its max value
JScrollPane