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();
root.setSizeFull();

    applicationMenuContainer = new VerticalLayout();
    
    applicationDepotsContainer = new VerticalLayout();
    applicationDepotsContainer.setSizeFull();
    applicationBodyContainer = new VerticalLayout();
    applicationBodyContainer.setSizeFull();
    
    HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(applicationDepotsContainer, applicationBodyContainer);
    splitPanel.setStyleName(Reindeer.SPLITPANEL_SMALL);
    splitPanel.setSplitPosition(30, Unit.PERCENTAGE);
    
    root.addComponent(applicationMenuContainer);
    root.addComponent(splitPanel);

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

Bruno

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