diff options
author | Denis Lila <[email protected]> | 2011-04-29 16:58:05 -0400 |
---|---|---|
committer | Denis Lila <[email protected]> | 2011-04-29 16:58:05 -0400 |
commit | 56d85fafd578e28fc17211d28f4f0a701192e789 (patch) | |
tree | 163144e2f7b4a7dcf42d38e35decc0ece28a03fb /plugin | |
parent | d11445dcf1ad408836766709c47f47ef2aec1d31 (diff) |
Fix appcontext related plugin bugs.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java index 486bab1..d974ca9 100644 --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java @@ -123,10 +123,10 @@ import com.sun.jndi.toolkit.url.UrlUtil; class PluginAppletPanelFactory { public AppletPanel createPanel(PluginStreamHandler streamhandler, - int identifier, - long handle, int x, int y, - final URL doc, - final Hashtable<String, String> atts) { + final int identifier, + final long handle, int x, int y, + final URL doc, + final Hashtable<String, String> atts) { final NetxPanel panel = AccessController.doPrivileged(new PrivilegedAction<NetxPanel>() { public NetxPanel run() { NetxPanel panel = new NetxPanel(doc, atts, false); @@ -136,13 +136,29 @@ class PluginAppletPanelFactory { } }); - // create the frame. - PluginAppletViewer.framePanel(identifier, handle, panel); - - panel.init(); + // Framing the panel needs to happen in a thread whose thread group + // is the same as the threadgroup of the applet thread. If this + // isn't the case, the awt eventqueue thread's context classloader + // won't be set to a JNLPClassLoader, and when an applet class needs + // to be loaded from the awt eventqueue, it won't be found. + Thread panelInit = new Thread(panel.getThreadGroup(), new Runnable() { + @Override public void run() { + panel.createNewAppContext(); + // create the frame. + PluginAppletViewer.framePanel(identifier, handle, panel); + panel.init(); + // Start the applet + initEventQueue(panel); + } + }, "NetXPanel initializer"); - // Start the applet - initEventQueue(panel); + panelInit.start(); + while(panelInit.isAlive()) { + try { + panelInit.join(); + } catch (InterruptedException e) { + } + } // Wait for the panel to initialize PluginAppletViewer.waitForAppletInit(panel); |