PDA

View Full Version : is it possible to maximize the browser window without JSNI?



pauloallonso
10 Oct 2011, 9:31 AM
I'm using this function to maximize the window:

/**
* Resize the principal window
*/
public static native void resizeWindow() /*-{
top.window.moveTo(0,0);
top.window.resizeTo(screen.availWidth,screen.availHeight);
}-*/;

is it possible to maximize the browser window without JSNI ? How can I get the avail Width and Height of the screen ? I have tried to use window.getClientHeight() for example, but this didn't work...

Colin Alworth
14 Oct 2011, 5:59 PM
Not that I know of – most well behaved web apps dont take over the screen for a variety of reasons, but building custom functionality not normally needed (or possible) in regular java is what jsni is for.

Why do you not want to use JSNI for this?