hello i've got a problem.
i copy a first applet code to NetBeans:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package netApplet;
import java.awt.*;
import java.applet.*;
import java.net.* ;
import com.jmex.awt.applet.SimpleJMEApplet ;
import com.jme.math.Vector3f ;
import com.jme.scene.TriMesh ;
import com.jme.math.Quaternion ;
import com.jme.scene.shape.Box ;
import com.jme.bounding.BoundingBox;
import com.jme.scene.state.TextureState ;
import com.jme.util.TextureManager ;
import com.jme.math.FastMath ;
import com.jme.scene.ImposterNode;
import com.jme.image.Texture;
import com.jme.scene.shape.Sphere;
import java.io.File;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.logging.Logger;
import org.lwjgl.test.WindowCreationTest ;
import com.jme.app.SimpleGame;
import com.jme.bounding.BoundingBox;
import com.jme.image.Texture;
import com.jme.math.Quaternion;
import com.jme.math.Vector3f;
import com.jme.scene.shape.Sphere;
import com.jme.scene.state.AlphaState;
import com.jme.scene.state.TextureState;
import com.jme.util.TextureManager;
import com.jme.util.resource.MultiFormatResourceLocator;
import com.jme.util.resource.ResourceLocatorTool;
import com.jme.util.resource.SimpleResourceLocator;
import com.jme.image.Image ;
import com.jme.image.util.* ; // image loadery
/*
<applet code="run" width=500 height=500>
</applet>
*/
/**
*
* @author mitrydates
*/
class ball implements Runnable {
public void run(){
try{
}catch(Exception e){
e.printStackTrace();
}
}
public void setData(){
}
}
public class run extends SimpleJMEApplet {
/**
* Initialization method that will be called after the applet is loaded
* into the browser.
*/
private TriMesh t;
private Quaternion rotQuat;
private float angle = 0;
private Vector3f axis;
public void simpleAppletSetup() {
getLightState().setEnabled(false);
rotQuat = new Quaternion();
axis = new Vector3f(1, 1, 0.5f).normalizeLocal();
Vector3f max = new Vector3f(25, 25, 25);
Vector3f min = new Vector3f(-25, -25, -25);
t = new Box("Box", min, max);
t.setModelBound(new BoundingBox());
t.updateModelBound();
t.setLocalTranslation(new Vector3f(0, 0, -150));
getRootNode().attachChild(t);
Sphere s = new Sphere("Sphere", 63, 50, 250);
s.setLocalTranslation(new Vector3f(10,10,-40));
s.setModelBound(new BoundingBox());
s.setRandomColors() ;
s.updateModelBound();
getRootNode().attachChild(s);
t.setRandomColors();
TextureState ts = getRenderer().createTextureState();
ts.setEnabled(true);
com.jme.image.Image img = new com.jme.image.Image();
try {
img = JPGLoader.loadImage(new java.io.FileInputStream("d:\iraq.jpg")) ; //new Image();
}catch(Exception e){
e.printStackTrace();
}
Texture tx = new Texture() ;
tx.setImage(img) ;
ts.setTexture(tx);
getRootNode().setRenderState(ts);
AlphaState alpha = getRenderer().createAlphaState();
alpha.setBlendEnabled(true);
alpha.setSrcFunction(AlphaState.SB_SRC_ALPHA);
alpha.setDstFunction(AlphaState.DB_ONE_MINUS_SRC_ALPHA);
alpha.setTestEnabled(true);
alpha.setTestFunction(AlphaState.TF_GREATER);
alpha.setEnabled(true);
getRootNode().setRenderState(alpha);
}
public void simpleAppletRender() {
if (status == STATUS_DESTROYING) {
com.jme.scene.ImposterNode in = new com.jme.scene.ImposterNode();
in.getTextureRenderer().cleanup();
status = STATUS_DEAD;
}
}
public void simpleAppletUpdate() {
float tpf = getTimePerFrame();
if (tpf < 1) {
angle = angle + (tpf * 25);
if (angle > 360) {
angle -= 360;
}
}
rotQuat.fromAngleNormalAxis(angle * FastMath.DEG_TO_RAD, axis);
t.setLocalRotation(rotQuat);
}
public void stop() {
status = STATUS_DESTROYING;
long time = System.currentTimeMillis();
while (status != STATUS_DEAD && (System.currentTimeMillis() - time) < 5000) { // only keep waiting for 5 secs
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
super.stop();
}
public void init() {
}
public void start(){
AppletContext ac = getAppletContext();
URL url = getCodeBase();
try{
//ac.showDocument(new URL(url + "netApplet/Test.html"));
}catch(Exception e){
e.printStackTrace();
}
}
public void paint(Graphics g){
}
// TODO overwrite start(), stop() and destroy() methods
}
i configured netBeans (i ' have no error) but when applet is started he is empty. ther is no object like sphere or box on him. where i have an error ??.