layout positions

hi the community

i try to positioante 3 layouts but i have some problems.

here is the simple code for a menubar and 2 splitted layout container.
root = new VerticalLayout();

    applicationMenuContainer = new VerticalLayout();
    applicationDepotsContainer = new VerticalLayout();
    applicationBodyContainer = new VerticalLayout();
    HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(applicationDepotsContainer, applicationBodyContainer);
    splitPanel.setSplitPosition(30, Unit.PERCENTAGE);

it produce the menubar at the top and the splitPanel start in the middle of the screen.
if i comment tthe menubar addComponent ( root.addComponent(applicationMenuContainer) , the splitPanel start from the top.

how to start the splitPanel just under the menuBar ?

thx for your advices


You have 2 components in your VerticalLayout: applicationMenuContainer and splitPanel.
You tell the VerticalLayout to take 100% of the height. So those 2 components take up the entire height, too. And each of them half of the height as you don’t tell Vaadin otherwise.

Add this after the last line:

setExpandRatio(splitPanel, 1);

to tell Vaadin that the SplitPanel should take most of the space.

thx it s work like a charm