Skip to content

Commit f1fdf06

Browse files
hansonrhansonr
authored andcommitted
minor
1 parent 00a7b1a commit f1fdf06

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

sources/net.sf.j2s.java.core/src/swingjs/JSToolkit.java

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.awt.Component;
77
import java.awt.Cursor;
88
import java.awt.Dialog;
9+
import java.awt.Dimension;
910
import java.awt.EventQueue;
1011
import java.awt.Font;
1112
import java.awt.FontMetrics;
@@ -125,36 +126,25 @@ public static void exit() {
125126

126127
// ////// java.awt.Toolkit /////////
127128

129+
public static void getScreenSize(Dimension d) {
130+
JQuery jq = JSUtil.jQuery;
131+
d.width = /** @j2sNative jq.$(window).width() || */0;
132+
d.height = /** @j2sNative jq.$(window).height() || */0;
133+
}
134+
135+
128136
@Override
129137
protected int getScreenWidth() {
130138
@SuppressWarnings("unused")
131139
JQuery jq = JSUtil.jQuery;
132-
int w = 0;
133-
/**
134-
* @j2sNative
135-
*
136-
* w = jq.$(window).width();
137-
*
138-
*/
139-
{
140-
}
141-
return w;
140+
return /** @j2sNative jq.$(window).width() || */0;
142141
}
143142

144143
@Override
145144
protected int getScreenHeight() {
146145
@SuppressWarnings("unused")
147146
JQuery jq = JSUtil.jQuery;
148-
int h = 0;
149-
/**
150-
* @j2sNative
151-
*
152-
* h = jq.$(window).height();
153-
*
154-
*/
155-
{
156-
}
157-
return h;
147+
return /** @j2sNative jq.$(window).height() || */0;
158148
}
159149

160150

0 commit comments

Comments
 (0)