Problem addin scroll to one panel or grid

Hello
i am making my first vaadin app. i am using vading 6.8.7
i have making one app that has one menubar. if i ckick into the menubar option appears one table paged (using the component PagedTable)
into the below layout i put the table and appears the pagination but i can not tu put the scroll and appears this error:
Exception
java.lang.IllegalStateException: com.vaadin.ui.GridLayout already has a parent.
at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:546)
at com.vaadin.ui.Panel.setContent(Panel.java:233)
at com.myfirstaplication.main.MyFirstApplicationManagerApplication.createCuerpo(MyFirstApplicationManagerApplication.java:71)
at com.myfirstaplication.main.MyFirstApplicationManagerApplication.showListExcursiones(MyFirstApplicationManagerApplication.java:87)

For this i have tne next code. Can you help me please for colving this error and to put the scroll?
thanks


package com.myfirstaplication.main;


import com.myfirstaplication.main.data.ExcursionesContainer;
import com.jensjansson.pagedtable.PagedTable;
import com.vaadin.Application;
import com.vaadin.data.Item;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.MenuItem;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;


public class MyFirstApplicationManagerApplication extends Application implements ClickListener,  ItemClickListener, java.io.Serializable {
    private final MenuBar menubar = new MenuBar();
	 GridLayout grid = new GridLayout();
     HorizontalLayout hl = new HorizontalLayout();
     Panel tablePanel = new Panel(); 
	 
	@Override
	public void init() {
        buildMainLayout();
       
	}
	
	 private void buildMainLayout() {
	        setMainWindow(new Window("MyFirstApplication Kudeaketa"));

	        setTheme("contacts");

	        VerticalLayout layout = new VerticalLayout();
	        
	        layout.setSizeFull();

	        layout.addComponent(createToolbar());
	       
	        layout.addComponent(grid);
	        
	        layout.setExpandRatio(grid, 1);
	        getMainWindow().setScrollable(true);
	        getMainWindow().setContent(layout);
	    }
	 private HorizontalLayout createToolbar() {
	        HorizontalLayout lo = new HorizontalLayout();
	     
	        MenuBar.MenuItem excursiones = menubar.addItem("Excursiones", null, null);
	        excursiones.addItem("Listar Todo", null, mycommand);
	        lo.addComponent(menubar);
	        
	        lo.setMargin(true);
	        lo.setSpacing(true);
	        
	        lo.setStyleName("toolbar");
	        lo.setWidth("100%");
	        return lo;
	    }
	 private  Panel createCuerpo(  final PagedTable c) {
		 grid.addComponent(c.createControls());		 
		 grid.addComponent(c);
		 tablePanel.setScrollable(true);
		 tablePanel.setSizeUndefined();
         tablePanel.setContent(grid);[color=#f00606]
[b]
//ERROR HERE
[/b]
[/color]
         tablePanel.setScrollable(true);
		 return tablePanel;
	 }
     
     // Define a common menu command for all the menu items.
        MenuBar.Command mycommand = new MenuBar.Command() {
            public void menuSelected(MenuItem selectedItem) {
                if("Listar Todo".equals(selectedItem.getText())){
                	System.out.println("listar todas las excursiones");
                	showListExcursiones();
                }
            }
        };

        private void showListExcursiones() {
            createCuerpo(ExcursionesContainer.dameTodasLasExcursiones(this));
        }

	@Override
	public void itemClick(ItemClickEvent event) {
		// TODO Auto-generated method stub
	}
	@Override
	public void buttonClick(ClickEvent event) {
		// TODO Auto-generated method stub
	}
}

You get the error because you have already attached the grid to the layout that forms the contents of your mainWindow. Perhaps you meant to add the tablePanel there instead? That component is not attached to anything right now as far as I can see.