将元素集中在gwt的装饰弹出面板中

时间:2013-02-06 09:59:12

标签: gwt uibinder gwt2

弹出窗口是一个装饰弹出窗口,其中的文本是标签,关闭是一个按钮。 我已将标签和按钮添加到水平面板,然后将其添加到弹出面板。我尝试过invalidEntryVpanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); invalidEntryVpanel.setHorizo​​ntalAlignment(HasHorizo​​ntalAlignment.ALIGN_CENTER);

但仍然无法在中心对齐请帮助。提前谢谢

1 个答案:

答案 0 :(得分:1)

试试这个

您必须在设置align center

后添加小部件
VerticalPanel vpnPanel = new VerticalPanel();
        vpnPanel.add(scrollPanel);   //all controls added to scrill panel with help of set widget 
        vpnPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        HorizontalPanel btnLayoutPanel = new HorizontalPanel();
        btnLayoutPanel.setSpacing(10);
        btnLayoutPanel.add(closeButton);
        vpnPanel.add(btnLayoutPanel);
        decPopuppanel.setWidget(vpnPanel);