Help! What is wrong with GridLayout?

Hi
Please help!
There is code

    GridLayout grid = new GridLayout();
    grid.setImmediate(false);
    grid.setWidth("100%");
    grid.setHeight("130px");
    grid.setMargin(false);
    grid.setColumns(2);
    grid.setRows(2);
    
    
    Label dFrom = new Label();
    dFrom.setImmediate(false);
    dFrom.setWidth("60px");
    dFrom.setHeight("30px");
    dFrom.setValue("Отчет: с");
    grid.addComponent(dFrom, 0, 0);
        grid.setComponentAlignment(dFrom, Alignment.TOP_RIGHT);
    
    PopupDateField dateField = new PopupDateField();
    dateField.setImmediate(false);
    dateField.setWidth("140px");
    dateField.setHeight("30px");
    grid.addComponent(dateField, 1, 0);
    
    Label dTo = new Label();
    dTo.setImmediate(false);
    dTo.setWidth("60px");
    dTo.setHeight("30px");
    dTo.setValue("по");
    grid.addComponent(dTo, 0, 1);
        grid.setComponentAlignment(dTo, Alignment.TOP_RIGHT);
    
    dateField = new PopupDateField();
    dateField.setImmediate(false);
    dateField.setWidth("140px");
    dateField.setHeight("30px");
    grid.addComponent(dateField, 1, 1);

Result: (see attached file)

  1. PopupDateField is shown on left, not in second column of grid
  2. Second PopupDateField is placed over label “по”
  3. Labels is not align RIGHT

Alexandr
12911.jpg

Set sizes of all labels undefined and use padding and margins to manipulate their size.

Thank you! It works…