Tabsheet problem

Hi

I am trying to create a tabsheet and I want the label (Status) to be aligned with the combo box but it seems that the combo box drifts down

Can you kindly help …

I have attached the image of the tabsheet

VerticalLayout layout= new VerticalLayout();
layout.setWidth(“300px”);

             TabSheet tabsheet = new TabSheet();
        layout.addComponent(tabsheet);

 
        VerticalLayout tab1 = new VerticalLayout();
        GridLayout grid = new GridLayout(3,1);
        grid.addComponent(new Label ("Status: "));
        ComboBox cmb= new ComboBox ("");
        grid.addComponent(cmb);
        tab1.addComponent(grid);
        tabsheet.addTab(tab1, "My queue");

    
        VerticalLayout tab2 = new VerticalLayout();
        tab2.addComponent(new Label("Tab2"));
        tab2.setCaption("Team Queue");
        tabsheet.addTab(tab2);
        return tabsheet;

14104.png

Hi,

If you want to keep components aligned with their captions, what about using FormLayout?

    private TabSheet createTabSheet() {
        TabSheet tabsheet = new TabSheet();
       
        VerticalLayout tab1 = new VerticalLayout();

        FormLayout formLayout = new FormLayout();

        ComboBox cmb = new ComboBox("Status:");
        formLayout.addComponent(cmb);
        tab1.addComponent(formLayout);

        tabsheet.addTab(tab1, "My queue");

        VerticalLayout tab2 = new VerticalLayout();
        tab2.addComponent(new Label("Tab2"));
        tab2.setCaption("Team Queue");
        tabsheet.addTab(tab2);

        return tabsheet;
    }