0

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

Ekata
  • 259
  • 2
  • 7
  • 21

1 Answers1

1

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);
enrybo
  • 1,787
  • 1
  • 12
  • 20
Suresh Atta
  • 120,458
  • 37
  • 198
  • 307