0

I'm using GWT, I'm creating StackLayoutPanel dynamically. For eg. I have 4 or 5 StackLayoutPanels in a VerticalPanel. I set height of StackLayoutPanel in pixels. If i don't set the Height i see only one StackLayoutPanel in the view instead of 4 or 5. I want to see all the panels but don't want to set the Height in pixels.

My code,

    StackLayoutPanel stackLayoutPanel = new StackLayoutPanel(Unit.EM);
    stackLayoutPanel.setHeight("300px");
    List<String> list = Lists.newArrayList();
    VerticalPanel vPanel = new VerticalPanel();
    for(String value : list) {
         stackLayoutPanel.add(new Label("Hello"), new Label("Hai"), 4);
    }
    vPanel.add(stackLayoutPanel);

Can anyone help me?

Thanks in advance, Gnik

Gnik
  • 7,120
  • 20
  • 79
  • 129

1 Answers1

0

Sometimes if those css properties are changed, those panels will be get disappeared sometimes. So just try to edit those, I might be wrong if so forgive me. For the container of the stacked layout panels I think it would be nice to have a flex table.

Juliyanage Silva
  • 2,529
  • 1
  • 21
  • 33