PDA

View Full Version : How to center VerticalPanel (horizontally and vertically)



vqck
19 Jul 2009, 4:51 PM
Hi All,
Could you please help me why this code does not center my VeticalPanel, which contains a FormPanel, when the browser is resized:



@Override
protected void onRender(Element parent, int index)
{
super.onRender(parent, index);
verticalPanel.add(createForm());
Window.addResizeHandler(new ResizeHandler()
{
public void onResize(ResizeEvent event)
{
verticalPanel.setHorizontalAlign(HorizontalAlignment.CENTER);
verticalPanel.setVerticalAlign(VerticalAlignment.MIDDLE);
}
});
add(verticalPanel);
}

vqck
20 Jul 2009, 6:29 PM
Hi All,
Could somebody help me with this? Thanks in advance.