Ashok
Ashok

Reputation: 1952

GWT Scrollpanel automatic scroll?

I'm developing an app in GWT. I'm using scrollpanel. This is what I'm trying to accomplish:

I add a panel(say verticalpanel of size: 500px,500px) to scrollpanel. With this size, there wouldn't probably be a scroll visible.Then I have an event that would change the widget in the scrollpanel. The new widget, lets say another verticalpanel of size: 2000px,2000px. I want the scrollpanel to adjust its size automatically and display the scroll (visible). Is this possible?

Thanks in advance!

Upvotes: 1

Views: 7005

Answers (1)

Adrian B.
Adrian B.

Reputation: 4363

What you are describing is actually how it works. You create a ScrollPanel of a certain size. If the content of said ScrollPanel is smaller than the ScrollPanel itself, no scrollbars are shown. If you change the content problematically the ScrollPanel will show scrollbars and let the user scroll accordingly.

Check the GWT documentation for more information:
http://google-web-toolkit.googlecode.com/svn/javadoc/2.3/com/google/gwt/user/client/ui/ScrollPanel.html

Upvotes: 5

Related Questions