title: How to add scrollbar to Vaadin layout
body: <p>I have found many questions where people are asking how to hide scrollbars in Vaadin layouts, but my problem is that Vaadin don't show me any scrollbars.
  For example I can have this code:</p>
  
  <pre><code>HorizontalLayout layout = new HorizontalLayout();
  layout.setSizeUndefined(); // I also tried setSizeFull()
  for(Integer i = 1; i &lt;= 15; i++) {
      layout.addComponent(new Button("Test button #" + i.toString());
  }
  </code></pre>
  
  <p>But when I run this code, buttons on the page are simply cut off when the browser window is too small to show them all. No scrollbars will appear ever.</p>
  
  <p>I have also tried to create Panel, and then add my layout to this panel. I have tested both - <code>panel.addComponent(foo)</code> and also <code>panel.setContent(foo)</code>, and I tried to set <code>panel.setScrollable(true)</code> too. Without any success.</p>
  
  <p>Is there any way to add scrollbar to some kind of Vaadin layout? I use Vaadin 6.8.7.
  Thanks in advance!</p>
  
  <hr>
  
  <p>There is my full code:</p>
  
  <pre><code>private ComponentContainer openZoomifyLayout() {
      Panel panel = new Panel();
      Panel panel2 = new Panel();
  
      middlePanel = new MiddlePanel();
  
      VerticalLayout mw = new VerticalLayout();
      mw.setSizeFull();
  
      HorizontalLayout sp = new HorizontalLayout();
      Panel photos = new Panel();
      photos.setSizeUndefined();
  
      mw.addComponent(panel);
      mw.addComponent(panel2);
      mw.addComponent(sp);
  
      mw.setExpandRatio(sp, 99);
      mw.setExpandRatio(panel, 0);
      mw.setExpandRatio(panel2, 0);
  
      panel2.addComponent(middlePanel);
  
      mw.setComponentAlignment(panel, Alignment.TOP_CENTER);
      mw.setComponentAlignment(panel2, Alignment.TOP_CENTER);
  
      photos.setContent(table);
      photos.setScrollable(true);
      sp.addComponent(photos);
      sp.addComponent(createMainDetail());
  
      return mw;
  }
  </code></pre>
  
  <p>This method is used in class which extends Window, and so in time of initialization is there: <code>setContent(openZoomifyLayout());</code></p>