JTextArea and a panel scrollbar
Hi,
the problem is with JTextArea. On a JPanel are placed several other smaller JPanels, one of them contains JTextArea. As this smaller panels take much space, certainly, the main panel has a scrollbar and not all the panels are visible at once. The panel with JTextArea is at the very bottom. And when I'm trying in run-time to set the value to this JTextArea using setText() or append() the main panel scrolls down to make the JTextArea visible. So how is it possible to make the scrollbar of the main panel leave on the top and not to scroll to the bottom after refreshing of JTextArea contents? The version of SDK used is 1.4.2_05.
Some workaround.
As I know this till Java 1.3 was marked as bug (the scrollbar stayed at the top, as needed now), in 1.4 the bug was fixed and only in 1.5 appeared some scrollbar policies for making it scrolling or not scrolling. But I need to get this in 1.4. Now even trying getVerticalScrollBar().setValue(0) for the main panel makes nothing (the scrollbar is still at the bottom), at the very top there are only panels so requestFocus() doesn't solve this problem. Is there any solution for 1.4?