View Full Version : How to get the child elements in center with Center layout

12 Dec 2009, 11:51 PM
I have GXT2.1 with GWT 1.7 on Ubuntu Linux.
I am trying to get the child widget in center of the container, and below is the code:
CenterLayout layout = new CenterLayout();
LayoutContainer container = new LayoutContainer(layout);
container.setSize("100%", "100%");
container.add(new Text("This text is in center layout"));
This aligns the widget to the middle (vertically) but horizontally it gets left aligned, x=0 ?
How am I suppose to use Center layout.

Thanks in advance.