JTextArea inside JScrollPane, scroll to position on set text
800402Jul 21 2008 — edited Jul 21 2008I have a JTextArea that I put inside JScrollPane during construction of the panel holding them. Elsewhere in the panel the user can click on various rows of a table that when clicked provide a description inside the JTextArea by calling it's setText(String). If the description is long enough the scroll pane bars appear and it automatically scrolls down to the bottom of the pane. If it's wide enough for the horizontal bar to show up it doesn't scroll that one (stays in lower left corner). This is not behavior I gave it, it's just doing it. Is there a way to force it to stay in the upper left corner regardless of what the contents are (whether by some call during construction or a call after every time I call setText on the JTextArea)? Thanks!