Hey guys, check this out.
I think I found the most elegant way to do the autoscroll thing with the JTextArea.
This worked just fine for me...
I extended a myTextArea class from the original JTextArea class. It Looks like this:
----------------------------------
import javax.swing.JTextArea;
public class myTextArea extends JTextArea {
public myTextArea(int rows, int cols) {
super(rows,cols);
}
public void append(
String text) {
super.append(text);
this.setCaretPosition(this.getCaretPosition()+text.length());
}
}
----------------------------------
So... everytime I make an append call to myTextArea the carret moves to the end of the TextArea and implicitly the scrolling component moves to the end.