Domanda

the pop up is a decorative pop up , the text in it is a label and close is a button. i have added the label and a button to horizontal panel and then added it to popup panel. i have tried with both invalidEntryVpanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); invalidEntryVpanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

but still not able to align it in center please help. thanks in advance

È stato utile?

Soluzione

Try like this

You have to add the widgets after you set the 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);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top