File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
sources/net.sf.j2s.java.core Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -315,7 +315,9 @@ public void setVisible(boolean b) {
315315 if (isModal ) {
316316 if (b ) {
317317 $ (body ).after (modalNode );
318- int z = getZIndex (null ) - 1 ;
318+ $ (modalNode ).addClass ("swingjs-window" ); // so as to slip into z-index ranking
319+ String sz = DOMNode .getStyle (domNode , "z-index" );
320+ int z = (( /** @j2sNative +sz || */ getZIndex (null ))) - 1 ;
319321 DOMNode .setStyles (modalNode , "z-index" , "" + z );
320322 }
321323 DOMNode .setVisible (modalNode , b );
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ public class JSWindowUI extends JSComponentUI implements WindowPeer {
4545
4646 private Graphics2D graphics ;
4747
48+ private Object dialogBlocker ;
49+
4850 /*
4951 * Not Lightweight; an independent space with RootPane, LayeredPane,
5052 * ContentPane, (optional) MenuBar, and GlassPane
@@ -103,13 +105,16 @@ public void toFront() {
103105 if (debugging )
104106 System .out .println ("window to front for " + id );
105107 z = J2S .setWindowZIndex (domNode , Integer .MAX_VALUE );
108+ if (modalNode != null )
109+ DOMNode .setZ (modalNode , z - 1 );
106110 }
107111
108112 @ Override
109113 public void toBack () {
110114 System .out .println ("window to back for " + id );
111115 z = J2S .setWindowZIndex (domNode , Integer .MIN_VALUE );
112-
116+ if (modalNode != null )
117+ DOMNode .setZ (modalNode , z - 1 );
113118 }
114119
115120 @ Override
@@ -133,6 +138,12 @@ public boolean requestWindowFocus() {
133138 @ Override
134139 public void setModalBlocked (Dialog blocker , boolean blocked ) {
135140 JSDialog b = ((JSDialog ) (Object ) blocker );
141+ dialogBlocker = (blocked ? b : null );
142+ }
143+
144+ @ Override
145+ public void setModalBlocked (JSDialog blocker , boolean blocked ) {
146+ dialogBlocker = (blocked ? blocker : null );
136147 }
137148
138149 @ Override
Original file line number Diff line number Diff line change @@ -2843,7 +2843,7 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
28432843 }
28442844 z = ( node . style . zIndex = ( z > 0 ? zbase : z0 ) ) ;
28452845 node . style . position = "absolute" ;
2846- if ( J2S . _checkLoading )
2846+ if ( J2S . _checkLoading )
28472847 System . out . println ( "setting z-index to " + z + " for " + node . id ) ;
28482848 return z ;
28492849 }
You can’t perform that action at this time.
0 commit comments