How do I move a JScrollbar of a JScrollPane?
807591Jun 19 2008 — edited Jun 19 2008Hello! I have a program in which I have a JScrollPane wrapping a JTextArea object. Whenever I set the text of the JTextArea to something fairly large, the JScrollPane automatically scrolls to the end of the JTextArea... leaving me with 2 questions.
1. How can I prevent a JScrollPane from automatically scrolling to the end of the JTextArea whenever I set the text of the JTextArea to a large block?
2. How can I programmatically move the position one of the JScrollPane's JScrollbars? In specific, I'd like to reset the Vertical scrollbar back to the top. I've tried using setValue(0) of the JScrollbar after calling the getVerticalScrollbar, but although it has changed the value (a call to getValue() shows it has been modified), it hasn't actually moved the scrollbar
I would REALLY appreciate any help... I'm new at using Swing and I kinda need this for work... Thanks!