I am creating a vertical gwt menubar and I am wonder if there is a way to detect the browser window boundary. I want to open a sub menu on the right (as its natural) if it doesn't cause it to go wider than the bounds of the browser window, otherwise I want to open to the left. Is there a way to programmatically know the bounds of the browser window to achieve this functionality.
You can use Window.getClientWidth()
and Window.getClientHeight()
to get the window boundaries.