GWT自动贴合复合材料

I have a main Composite that contains SplitLayoutPanel containing StackLayoutPanel on left side and Gwt Map window on right side. How to properly set their sizes and properties so that they always fit the entire browser window?

  • set the size of the left component to 100%
  • do same for the right component
  • fit the main Composite using Window.getClientWidth() and Window.getClientHeight()

That's how I achieved it, but honestly I am not entirely happy. You have to listen for resize events of window and hardcoded sizes are hard to maintain with different browsers.

By the way, RootLayoutPanel is designed to fit the entire window, so you might want to set composite's size to 100% and place it to RootLayoutPanel and see how does that work :) Please give some feedback about this, I am also interested.

I think using ResizeComposite instead of a Composite and adding this widget directly to RootLayoutPanel should work.