title: Vaadin Layout - how to get a panel to expand to fill most of the screen
body: <p>Please note I'm Using Vaadin for this.</p>
  
  <p>I'm struggling to get the middle panel to expand to fill most of the screen with a header and footer at the top and bottom respectively. Here's my code:</p>
  
  <pre><code>public class GridpocApplication extends Application {
  
  @Override
  public void init() {
      System.out.println("starting now.");
  
      final Window mainWindow = new Window("My Application");
      setMainWindow(mainWindow);
  
      mainWindow.getContent().setSizeFull();
  
      VerticalLayout mainColumn = new VerticalLayout();
      //Header
      Label top = new Label("HEADER");
      mainColumn.addComponent(top);
  
      //The middle bit
      final Panel middlePanel = new Panel();
      middlePanel.setSizeFull();
      middlePanel.getContent().setSizeUndefined();
      middlePanel.setScrollable(true);
      mainColumn.addComponent(middlePanel);
      mainColumn.setExpandRatio(middlePanel, 1.0f);
  
      //footer
      Label bottom = new Label("FOOTER");
      mainColumn.addComponent(bottom);
      mainWindow.addComponent(mainColumn);
  
      //test
      Label test= new Label("This area should fill most of the screen.");
      middlePanel.addComponent(test);
  }
  }
  </code></pre>
  
  <p>Where am I going wrong? What I see is this:</p>
  
  <p><img src="https://i685.photobucket.com/albums/vv216/IronSnake42/techy/display.jpg" alt="Valid XHTML"></p>