Skip to content

Commit 268560d

Browse files
committed
fix for JFrame initalization during first JFrame initialization
1 parent 88b17c4 commit 268560d

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

sources/net.sf.j2s.java.core/src/java/lang/ThreadGroup.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,4 +1073,17 @@ public String toString() {
10731073
g.秘html5Applet = 秘html5Applet;
10741074
g.秘timerQueue = 秘timerQueue;
10751075
}
1076+
1077+
public JSAppletViewer 秘getAppletViewer() {
1078+
JSAppletViewer a = this.秘appletViewer;
1079+
if (a == null) {
1080+
/**
1081+
* @j2sNative
1082+
*
1083+
* a = this.秘html5Applet._appletPanel;
1084+
*/
1085+
this.秘appletViewer = a;
1086+
}
1087+
return a;
1088+
}
10761089
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ public JSFrameViewer setForWindow(RootPaneContainer c) {
6060
// JApplet, JDialog, JFrame (including JInternalFrame), JRootPane, JWindow
6161
isFrame = true;
6262
top = c;
63+
if (((JSComponent) top).秘appletViewer == null) {
64+
((JSComponent) top).秘appletViewer = Thread.currentThread().getThreadGroup().秘getAppletViewer();
65+
}
6366
appletViewer = ((JSComponent)top).秘appletViewer;
6467
if (c instanceof JApplet)
6568
applet = (JApplet) c;

0 commit comments

Comments
 (0)