Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Empty Space VerticalLayout
Hi,
I'am creating a Vaadin Application and have some trouble with my Layouts.
After a succesful login the following Method is called:
private void buildMainLayout() {
/* create Mainwindow */
mainWindow = new Window("Some Content");
mainWindow.setSizeFull();
/* Mainlayout */
vLayout = new VerticalLayout();
vLayout.setSpacing(true);
vLayout.setMargin(false);
vLayout.setSizeFull();
//CustumMenubar
cmsMenuBar = new CmsMenue(this);
cmsMenuBar.setWidth("100%");
/* Combobox */
ComboBox patientBox = new ComboBox();
patientBox.setWidth("100%");
patientBox.setInputPrompt("choose Person");
patientBox.setStyleName("XXXXX");
/* Label */
sessionInfo = new Label();
sessionInfo.setValue("like this");
/* Putting it all in a HLayout*/
HorizontalLayout hLayout = new HorizontalLayout();
hLayout.setWidth("100%");
hLayout.addComponent(cmsMenuBar);
hLayout.addComponent(sessionInfo);
hLayout.addComponent(patientBox);
hLayout.setExpandRatio(cmsMenuBar, 6);
hLayout.setExpandRatio(sessionInfo, 1);
hLayout.setExpandRatio(patientBox, 1);
vLayout.addComponent(hLayout);
/* Layout for Maincontent
* This is to disply different Components beneath the Menubar, when
*/
mainContent = new VerticalLayout();
vLayout.addComponent(mainContent);
mainWindow.setContent(vLayout);
setMainWindow(mainWindow);
}
Additionally i got a function which is called when a user clicks a menuitem. This function displays the choosen Component (Calendar, Form etc..).
private void setMainComponent(Component c){
mainContent.removeAllComponents();
mainContent.addComponent(c);
}
The Problem is that between the horizontal layout and the component which is displayed by the setMainComponent Function on the vertical layout (mainContent),
an empty space remains.
I have tried a setSizeFull() on all components. I've tried it too in the setMainComponent function and this results a smaller empty space, but i think this is the wrong place to call on an configuration function. And it still remains the half of the space.
I have examined my application page with Firebug and it shows a <div> which encloses the Horizontal layout, and its precisely the empty space. But dunno which layout or component it should be.
Thank you in advance,
Frederik