Hey folks,
Got a small problem. I want to embed my Swing .JAR in my Browser and run it. All I get to see is a grey area, although it seems to load something for a couple of seconds.
The HTML code is as following:
And the Java Code:HTML Code:<html> <head><title>Jass Client</title></head> <body> <applet code="jassclient.Main.class" name="Applet" archive="JassClient.jar" width="700" height="700"> Not working... </applet> </body> </html>
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package jassclient; import jassclient.display.GameGUI; import engine.Game; import engine.Gateway; import java.applet.Applet; import java.awt.Container; import javax.swing.JApplet; import javax.swing.SwingUtilities; /** * * @author ruffy */ public class Main extends JApplet { private static GameGUI gameGUI; @Override public void init() { //Execute a job on the event-dispatching thread; creating this applet's GUI. try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { GameGUI gameGUI = new GameGUI(); setContentPane(gameGUI); //gameGUI = new GameGUI(); gameGUI.setVisible(true); } }); } catch (Exception e) { System.err.println("createGUI didn't complete successfully"); } } }
Any help would be greatly appreciated!