0

我有一个 gwt-ext 窗口(用作弹出窗口),这个弹出窗口是从 GWT 应用程序启动的。我正在寻找一种解决方案,将弹出窗口的窗口大小设置为一个大小,它几乎填满屏幕,而不是最大化,而是填充启动此弹出窗口的 GWT 应用程序的底层部分的区域。有人知道该问题的解决方案吗?

4

2 回答 2

3

尝试这样的事情:

int windowHeight=Window.getClientHeight()-10; //I subtract 10 from the client height so the window isn't maximized.
int windowWidth=Window.getClientWidth()-10; //I subtract 10 from the client width so the window isn't maximized.
yourExtGwtWindow.setHeight(windowHeight);
yourExtGwtWindow.setWidth(windowWidth);
于 2011-01-04T12:12:48.627 回答
1

这将调整为屏幕大小(不是当前浏览器大小)

yourExtGwtWindow.setHeight(screenHeight());
yourExtGwtWindow.setWidth(screenWidth());

...

public static native int screenWidth() 
/*-{ 
      return screen.availWidth; 
}-*/; 

public static native int screenHeight() 
/*-{ 
      return screen.availHeight;
}-*/; 
于 2012-08-22T05:33:33.623 回答