I am beginning to understand applets but i have a problem: i am testing it with xampp, and if i launch it with jnlp it does not work, grey box.
I have a jar packed made by eclipse, i set it in the same folder of index.html, as the jnlp file. I have tryed without jnlp with this code and it works:
<script src="
http://www.java.com/js/deployJava.js"></script>
<script>
var attributes = {code:'myApplet.MyApplet.class',
archive:'MyApplet.jar', width:710, height:540};
var parameters = { fontSize:16, permissions:'sandbox' };
var version = '1.6';
deployJava.runApplet(attributes, parameters, version);
</script>
this is the code of jnlp file:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="myApplet.jnlp">
<information>
<title>My First Applet</title>
<vendor></vendor>
</information>
<resources>
<!-- Application Resources -->
<j2se version="1.6+" href="
http://java.sun.com/products/autodl/j2se"/ >
<jar href="MyApplet.jar" main="true" />
</resources>
<applet-desc
name="My Applet"
main-class="myApplet.MyApplet"
width="400"
height="200">
</applet-desc>
</jnlp>
this is the code of index.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
</head>
<body>
<h1>It works!</h1>
<script src="
http://www.java.com/js/deployJava.js"></script>
<script>
var attributes = {code:'myApplet.MyApplet.class', archive:'MyApplet.jar'};
var parameters = { fontSize:16, jnlp_href:'myApplet.jnlp' };
var version = '1.6' ;
deployJava.runApplet(attributes, parameters, version);
</script>
</body>
</html>
I have also another question: i would like to know how have I to do with eclipse to make a runnable jar putting music, pictures inside... I know it is a noob question, but I am very noob...