Search code examples
uibinder

Is the layout for a vertical panel with components correct?


How to insert a vertical panel in the form for laying out the components in a vertical layout fashion.

For example as Component 1 Component 2 Component 3.

Please give me an example code. I want to fit it in the following fashion! Display of the panels


Solution

  • HorizontalPanel mainPanel = new HorizontalPanel();
    
    VerticalPanel leftSidePanel = new VerticalPanel();
    TextBox textBox1 = new TextBox();
    TextBox textBox2 = new TextBox();
    
    leftSidePanel.addMember(textBox1);
    leftSidePanel.addMember(textBox2);
    
    VerticalPanel rightSidePanel = new VerticalPanel();
    ListBox listBox = new ListBox();
    listBox.addItem("value1","value1");
    listBox.addItem("value2","value2");
    
    rigthSidePanel.addMember(listBox);
    
    mainPanel.addMember(leftSidePanel);
    mainPanel.addMember(rightSidePanel);