Java code for screen resolution

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");
+5
source share
3 answers

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.

+1
source

, , , , , . , . ,

, . 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 .

, , .

, .

+1

All Articles