Hello,

I am programmatically setting the text of a bunch of textfields on a gui. When the gui loads up, after the text is set, the scrollbar appears down the scrollpane. My question is how to programmatically reset the scrollbar to the top of the pane.

I have tried the following to no avail:

Code:
_infoScrollPane.getVerticalScrollBar().setValue(0);
and also
Code:
Rectangle rect = _infoScrollPane.getVisibleRect();
rect.x = 0;
rect.y = 0;
_infoScrollPane.scrollRectToVisible(rect);
Both attempts made no visible change to the scrollbar.

Is there a more proper way to reset the vertical scrollbar to the top of the pane?


Thanks,
Anthony Bargnesi