Can some one help me with deploying applet into jar file and embending this jar into html page?
Here's code of my applet:
package jmetest.awt.applet;
import com.jme.bounding.BoundingBox;
import com.jme.math.FastMath;
import com.jme.math.Quaternion;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.TriMesh;
import com.jme.scene.shape.Box;
import com.jmex.awt.applet.SimpleJMEApplet;
public class AppletTestBoxColor extends SimpleJMEApplet {
private static final long serialVersionUID = 1L;
private TriMesh t;
private Quaternion rotQuat;
private float angle = 0;
private Vector3f axis;
public void simpleAppletUpdate() {
float tpf = getTimePerFrame();
if (tpf < 1) {
angle = angle + (tpf * 35);
if (angle > 360) {
angle -= 360;
}
}
rotQuat.fromAngleNormalAxis(angle * FastMath.DEG_TO_RAD, axis);
t.setLocalRotation(rotQuat);
}
public void simpleAppletSetup() {
getLightState().setEnabled(false);
rotQuat = new Quaternion();
axis = new Vector3f(1, 1, 0.5f).normalizeLocal();
Vector3f max = new Vector3f(5, 5, 5);
Vector3f min = new Vector3f(-5, -5, -5);
t = new Box("Box", min, max);
t.setModelBound(new BoundingBox());
t.updateModelBound();
t.setLocalTranslation(new Vector3f(0, 0, -15));
getRootNode().attachChild(t);
t.setRandomColors();
getRenderer().setBackgroundColor(ColorRGBA.randomColor());
}
}
Jar file is exported from eclipse IDE. It's called "myapplet.jar"
It contains some directories inside:
.jmetestawtapplet
.META-INF
In first directory tree there are two files:
AppletTestBoxColor.class
AppletTestBoxColor.java
In second directory there is only one file:
MANIFEST.MF
Manifest-Version: 1.0
Main-Class: jmetest.awt.applet.AppletTestBoxColor
Here is my html file, I trying to use lwjgl applet loader...
<html>
<body style="background-color:gray">
<applet code="org.lwjgl.util.applet.AppletLoader" archive="lwjgl_util_applet.jar, lzma.jar, myapplet.jar" codebase="." width="720" height="480">
<param name="al_title" value="appletloadertest">
<param name="al_main" value="jmetest.awt.applet.AppletTestBoxColor">
<param name="al_logo" value="appletlogo.png">
<param name="al_progressbar" value="appletprogress.gif">
<param name="al_jars" value="lwjgl_applet.jar.pack.lzma, lwjgl.jar.pack.lzma, jinput.jar.pack.lzma, lwjgl_util.jar.pack.lzma, res.jar.lzma">
<param name="al_windows" value="windows_natives.jar.lzma">
<param name="al_linux" value="linux_natives.jar.lzma">
<param name="al_mac" value="macosx_natives.jar.lzma">
</applet>
</body>
</html>
When I open this html file in web browser (Firefox or IE8) there's "lwjgl" logo, progress bar... but it hangs on "switching applets"...
Can someone help me with this!?