While creating a small aplication in ExtGwt I’ve bumped into such problem:
Is there any way to center the content of the ContentPanel horizontally (and only horizontally) ?
I know the one solution is to use:
ContentPanel panel = new ContentPanel();
panel.setLayout(new CenterLayout());
//but here is the problem, I MUST set the size of panel
panel.setSize(400, 200);
However, I need this panel to have dinamically calculated height, because it has different content in various places.
Other thing is to use UIBinder, but that’s somehow also not a good idea.
Anyone has idea how to achieve such solution?
layout the
ContentPanelinside its container with aFitLayout. that way, theContentPanel‘s size is always managed, and you won’t have to specify it’s dimensions.