code: public static ScrollPanel newScrollPanel (Widget contents, int xpad, int ypad)
      {
          ScrollPanel panel = new ScrollPanel(contents);
          if (xpad >= 0) {
              String maxWidth = (Window.getClientWidth() - xpad) + "px";
              DOM.setStyleAttribute(panel.getElement(), "maxWidth", maxWidth);
          }
          if (ypad >= 0) {
              String maxHeight = (Window.getClientHeight() - ypad) + "px";
              DOM.setStyleAttribute(panel.getElement(), "maxHeight", maxHeight);
          }
          return panel;
      }
docs: Wraps the supplied contents in a scroll panel that will set the max-width to
  Window.getClientWidth()-xpad and the max-height to Window.getClientHeight()-ypad. If either
  xpad or ypad are less than zero, the max-size attribute on that axis will not be set.