File tree Expand file tree Collapse file tree 1 file changed +10
-20
lines changed
sources/net.sf.j2s.java.core/src/swingjs Expand file tree Collapse file tree 1 file changed +10
-20
lines changed Original file line number Diff line number Diff line change 66import java .awt .Component ;
77import java .awt .Cursor ;
88import java .awt .Dialog ;
9+ import java .awt .Dimension ;
910import java .awt .EventQueue ;
1011import java .awt .Font ;
1112import 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
You can’t perform that action at this time.
0 commit comments