File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
sources/net.sf.j2s.java.core/src/swingjs Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -468,8 +468,17 @@ public static void setIsDispatchThread(boolean b) {
468468// // NO LONGER NECESSARY :)
469469// }
470470
471+ /**
472+ * Get the applet associated with the specified component or, if that is null,
473+ * the current thread. This could be an important issue if one applet is running
474+ * code in a different applet.
475+ *
476+ * @param c
477+ * @return
478+ */
471479 public static HTML5Applet getHTML5Applet (Component c ) {
472- return ((JSThreadGroup ) c .getAppContext ().getThreadGroup ()).getHtmlApplet ();
480+ ThreadGroup g = (c == null ? Thread .currentThread ().getThreadGroup () : c .getAppContext ().getThreadGroup ());
481+ return ((JSThreadGroup ) g ).getHtmlApplet ();
473482 }
474483
475484 public static void taintUI (Component c ) {
You can’t perform that action at this time.
0 commit comments