开发者

Can't add components in VerticalSplitPanel

开发者 https://www.devze.com 2023-03-26 22:08 出处:网络
I am building an application using the VAADIN framework. I am trying to add a panel in a view containing a VerticalSplitPanel which contains two components (a button and a label for the moment).

I am building an application using the VAADIN framework.

I am trying to add a panel in a view containing a VerticalSplitPanel which contains two components (a button and a label for the moment).

Pretty straight forward but I'm having big problems getting it done.

I can identify that something happens, because I see the "split-divider" show when I run it in a browser, but no components inside the split-panel.

This is how I initialize the panel for the moment.

public class M2MInventory_SubscriptionsView extends AbstractView    {

private Panel panel = new Panel();
private VerticalSplitPanel vSplit = new VerticalSplitPanel();
private Button upperButton = new Button("Upper Button");
private Button lowerButton = new Button("Lower Button");

    public M2MInventory_SubscriptionsView() {

    panel.setContent(vSplit);
    vSplit.setFirstComponent(new Button("Upper"));
    vSplit.setSecondComponent(new Label("Lower"));

    addComponent(panel);
}

Can anyo开发者_开发问答ne spot an error in my ways?


Try to set panel height first. It will work but I'm not sure why.

The default layout of Panel is VerticalLayout with undefined height. It's strange, because I thought If you insert enough components in such a layout, it will grow.

0

精彩评论

暂无评论...
验证码 换一张
取 消