I would like to know how to fix the resolution of the browser for PC settings 1280X720, so that the web application developed in java using gwt does not look stretched. I tried
int width= windows.getClientWidth(); int height= windows.getClientHeight(); RootPanel.get().setHeight(height + "px"); RootPanel.get().setWidth(width + "px");
You probably have the main component that is added to RootPanel. A DockPanelor LayoutPanelor whatever you use as the top component. Just fix the size of this panel and there you go. RootPanel.get()gives you a handle to the body element, resizing the body element of the site does not make sense.
RootPanel
DockPanel
LayoutPanel
RootPanel.get()
, , , , , . , . ,
, . x, y , , .
x, y, ,
g.drawImage(inventory, width - 499, height / 2 - 20, null); int ixt = width - 499; int iyt = height / 2 - 20; g.drawImage(broadsword, ixt + 10, iyt + 10, null);
0,0 10 .
, , .
, .
Window.resizeBy(500, 400);
window.open.
window.open
http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/Window.html#resizeBy(int, int)