From: <ma...@us...> - 2007-10-24 21:55:42
|
Revision: 2909 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=2909&view=rev Author: matzon Date: 2007-10-24 14:55:39 -0700 (Wed, 24 Oct 2007) Log Message: ----------- miscellaneous minor fixes to improve the loading and displaying of the applet Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2007-10-24 21:25:54 UTC (rev 2908) +++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2007-10-24 21:55:39 UTC (rev 2909) @@ -33,8 +33,8 @@ import java.applet.Applet; import java.applet.AppletStub; +import java.awt.BorderLayout; import java.awt.Color; -import java.awt.FlowLayout; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Image; @@ -207,6 +207,8 @@ */ public void init() { + state = STATE_INIT; + // sanity check String[] requiredArgs = {"al_main", "al_logo", "al_progressbar", "al_jars"}; for(int i=0; i<requiredArgs.length; i++) { @@ -221,6 +223,8 @@ // get colors of applet bgColor = getColor("al_bgcolor", Color.white); + setBackground(bgColor); + fgColor = getColor("al_fgcolor", Color.black); errorColor = getColor("al_errorcolor", Color.red); @@ -621,7 +625,7 @@ * replace the current applet with the lwjgl applet * using AppletStub and initialise and start it */ - protected void switchApplet() throws Exception { + protected synchronized void switchApplet() throws Exception { state = STATE_SWITCHING_APPLET; percentage = 100; @@ -636,7 +640,7 @@ lwjglApplet.setStub(this); lwjglApplet.setSize(getWidth(), getHeight()); - setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0)); + setLayout(new BorderLayout()); add(lwjglApplet); state = STATE_INITIALIZE_REAL_APPLET; @@ -644,7 +648,12 @@ state = STATE_START_REAL_APPLET; lwjglApplet.start(); + + + // fix for issue with applet not showing up in firefox + setVisible(false); validate(); + setVisible(true); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |