How to scroll to the end of an updating JTextPane
While working on a Chat client for school, I needed a way to scroll down to the end of the chat conversation JTextPane every time a message was sent.
I found the solution in coderanch.com
JTextPane output = new JTextPane();
output.setCaretPosition(output.getDocument().getLength());
javadoc for setCaretPosition()