private BeanItemContainer<Window> windowlist = new BeanItemContainer<Window>(
Window.class);
@Override
protected void setup() {
UI mainWindow = getMainWindow();
HorizontalLayout controlpanels = new HorizontalLayout();
for (int i = 1; i <= 5; i++) {
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
Window dialog = new Window("Dialog " + i, layout);
layout.setSizeUndefined();
windowlist.addBean(dialog);
layout.addComponent(new Label("this is dialog number " + i));
layout.addComponent(new ControlPanel());
mainWindow.addWindow(dialog);
}
controlpanels.addComponent(new ControlPanel());
getLayout().setSizeFull();
getLayout().addComponent(controlpanels);
getLayout().setComponentAlignment(controlpanels, Alignment.BOTTOM_LEFT);