AppletLoader - Fix for a crash on some platforms before the permissions dialog appears, this is because the relevant part of the code needed to be run on the EDT.

This commit is contained in:
kappa1 2011-01-22 18:08:21 +00:00
parent 2e25b096b7
commit de3d22e230
1 changed files with 13 additions and 4 deletions

View File

@ -35,6 +35,7 @@ import java.applet.Applet;
import java.applet.AppletStub;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Image;
@ -765,10 +766,18 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
setLWJGLProperties();
// switch to LWJGL Applet
switchApplet();
setState(STATE_DONE);
repaint();
EventQueue.invokeAndWait(new Runnable() {
public void run() {
try {
switchApplet();
} catch (Exception e) {
fatalErrorOccured("This occurred while '" + getDescriptionForState() + "'", e);
}
setState(STATE_DONE);
repaint();
}
});
} catch (AccessControlException ace) {
fatalErrorOccured(ace.getMessage(), ace);
certificateRefused = true;