How to make "anchors" for a component?

Hi all
There is an example:


 VerticalLayout layout = new VerticalLayout();
    layout.setHeight("400px");
    //layout.setSizeFull()
    
    Button bt = new Button("---");
    bt.setHeight("100%")    
    layout.addComponent(bt);
    layout.setExpandRatio(bt, 1.0f);

    TabSheet npad= new TabSheet();
    final Panel p1 = new Panel()
    npad.addTab(p1, "1111", null);
    final Panel p2 = new Panel()
    npad.addTab(p2, "2222", null);
    npad.setHeight("100%")
    //npad.setSizeFull()
    layout.addComponent(npad)
    layout.setExpandRatio(npad, (float) 3 * 1.0f);

    Window win = new Window();
    win.setModal(true)
    win.addComponent(layout)
    getWindow().addWindow(win)

So, the tabsheet has a triple height than the button. But I need the tabsheet will resize with the window “anchering” to its bottom. How can I do it? You can see that I’ve tried to setSizeFull() - unfortunately…

This is a WORKING code:


 VerticalLayout layout = new VerticalLayout();

    layout.setSizeFull()
    
    Button bt = new Button("---");
    bt.setHeight("100%")    
    layout.addComponent(bt);
    layout.setExpandRatio(bt, 1.0f);

    TabSheet npad= new TabSheet();
    final Panel p1 = new Panel()
    npad.addTab(p1, "1111", null);
    final Panel p2 = new Panel()
    npad.addTab(p2, "2222", null);
    //npad.setHeight("100%")
    npad.setSizeFull()
    layout.addComponent(npad)
    layout.setExpandRatio(npad, (float) 3 * 1.0f);