JScrollPane Question

Hello.I have a JScrollPane that contains a JTextArea which I am using for a log. What can I do to center the scoll to the bottom as lines of text get added to the TextArea?Thanks for any help.
[213 byte] By [HappyDaysa] at [2007-10-2 21:16:22]
# 1
Use can move the cursor using the setCaretPosition method of the JTextAreaor you can ge the vertical scroll bar from the ScrollPane and set its value to minimum value
LRMKa at 2007-7-14 0:24:30 > top of Java-index,Java Essentials,Java Programming...
# 2
Would you mind to write a small sample? Thanks.
HappyDaysa at 2007-7-14 0:24:30 > top of Java-index,Java Essentials,Java Programming...
# 3

//method 1

textArea.setCaretPosition(textArea.getText().length());

//method 2 - you have to have a reference of JScrollPane object

JScrollBar sb = jscrollPane.getVerticalScrollBar()

sb.setValue(sb.getMinimum());

LRMKa at 2007-7-14 0:24:30 > top of Java-index,Java Essentials,Java Programming...