Having trouble displaying an Applet

146 Views Asked by At

I am attempting to display a working applet in Firefox (and will also want to display it in IE). I am using the following in my HTML:

<script src="http://www.java.com/js/deployJava.js"></script>
<script> 
    var attributes = {
        code:'home.applets.demo.demo1.class',  width:300, height:300} ; 
    var parameters = {jnlp_href: 'test.jnlp'} ; 
    deployJava.runApplet(attributes, parameters, '1.6');       
</script>

My test.jnlp file contains the following:

<jnlp spec="1.0+" codebase="" href="">
<information>
    <title>Bouncing Balls Demo</title>
    <vendor>Me</vendor>
</information>
<resources>
    <!-- Application Resources -->
    <j2se version="1.6+"
        href="http://java.sun.com/products/autodl/j2se" />
    <jar href="demo1.jar" main="true" />

</resources>
<applet-desc 
     name="Bouncing Balls Demo Applet"
     main-class="home.applets.demo.demo1"
     width="300"
     height="300">
 </applet-desc>
 <update check="background"/>
</jnlp>  

It looks to me as if I have done everything I need to do. I placed the JNLP and JAR file in the same directory as the HTML file. It looks like my JNLP and HTML are correct, yet when I display the page the applet does not appear. Even worse, there are no failure messages or anything to indicate that anything is happening at all!

Am I missing something here? Someone please advise.

1

There are 1 best solutions below

0
4drenaline On

First thing I would suggest to do it go into your control panel>java>advance and enable the java console.

Second, while in the java console press 5 so you can see all error levels

Third, if you are testing this on a webserver try testing it locally.

Fourth, if it is only not working on the webserver make sure that you have enabled jnlp Mime types in the IIS server.