Java applet

Hey i have made a 2D game that runs fine when i launch it stright from eclipse in its java applet tester however when i try to embed it into html and launch it on my browser firefox it wont load…

its not even giving me the usual ‘Click for error details’ so i have no idea what be could causing my problem. Is it how ive embedded it?


I havnt used a package to make the game and all the recources and such are stright in the jar

I’d assume that your html does have the boiler plate stuff right?


<Html>
<Head>
<Title>Java Example</Title>
</Head>
<Body>
Applet Test!
//your applet stuff goes here
</Applet>
</Body>
</Html> 

yea its got all the border plate stuff, it was working a few hours ago with a simple game wher i just moved a guy around with nothing else atall emplemented and now its not loading

The simplest of recommended way to deploy:

http://download.oracle.com/javase/tutorial/deployment/deploymentInDepth/runAppletFunction.html

// launch the Java 2D applet on JRE version 1.6.0 or higher with one parameter (fontSize)
<script src="http://www.java.com/js/deployJava.js"></script>
<script>
    var attributes = {code:'java2d.Java2DemoApplet.class',
        archive:'http://java.sun.com/products/plugin/1.5.0/demos/plugin/jfc/Java2D/Java2Demo.jar',
        width:710, height:540} ;
    var parameters = {fontSize:16} ;
    var version = '1.6' ;
    deployJava.runApplet(attributes, parameters, version);
</script>


It works well. There are more complicated options, like using JNLP if you want to read or write on the client. But the above works for the basic scenario.

Lots of things “work” in Eclipse that don’t work online. From Eclipse, there are no restrictions about making use of your own file system or resources. But from the web, your computer is considered off limits, unless you use something like signing or JNLP.