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 visibl开发者_StackOverflowe.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!
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
精彩评论