Applet doesn't work

Hi monkeys,

I’m having problems with my java applet distribution.
My code works fine for a normal java application on the desktop, but when I’m trying to run it as an applet I get the following error:

Exception in thread “LWJGL Renderer Thread” java.lang.NullPointerException
at mygame.Player.update(Player.java:76)
at mygame.Main.simpleUpdate(Main.java:406)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:241)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglCanvas.runLoop(LwjglCanvas.java:229)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
at java.lang.Thread.run(Unknown Source)

The background sounds, still works in the applet, but nothing is shown.

The project is build with the following libraries:

  • jme3
  • jm3-libraries-lwjgl-minimum
  • lwjgl-applet

And here is my code for the Player:
[java]
/*

  • To change this template, choose Tools | Templates
  • and open the template in the editor.
    */
    package mygame;

import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector2f;
import java.util.LinkedList;

/**
*

  • @author Kevin
    */
    public class Player {
    int score;
    double speed;
    double bonusTime = 0;
    boolean isPowerUp;
    ColorRGBA color = new ColorRGBA(0,1,0,1);
    Vector2f direction = new Vector2f();
    Vector2f head = new Vector2f();
    LinkedList snake = new LinkedList();

    public Player(){
    score = 0;
    color = new ColorRGBA(0, 1, 0, 1);
    direction = new Vector2f(0,1);
    speed = 0.180;

     snake.add(new Vector2f(7,5));
     head = new Vector2f(7,5);
    

    }

    private void playAppleSound(){
    Main.app.audio_apple.playInstance();
    }

    private void playMirrorSound(){
    Main.app.audio_mirrorWorld.playInstance();
    }

    public void update(ColorRGBA[][] colors){
    Vector2f temp = new Vector2f();

     temp.x = (int)this.head.x + (int)this.direction.x;
     temp.y = (int)this.head.y + (int)this.direction.y;	
    
     if(temp.y >= 12 ){
             temp.y = 0;
     }else if(temp.y = 12 ){
             temp.x = 0;
     }else if(temp.x  30.0){
             isPowerUp = false;
             this.speed = 0.180;
             Main.app.stopMirrorMode();
         }
     }else{
         bonusTime = 0;
     }
     
     if(!(colors[(int)this.head.x][(int)this.head.y].equals(ColorRGBA.Blue))){
         if(colors[(int)this.head.x][(int)this.head.y].equals(ColorRGBA.Red)){
             playAppleSound();
             this.score += 1;
             Main.removeApple((int)this.head.x, (int)this.head.y);                
         }
         else if(colors[(int)this.head.x][(int)this.head.y].equals(ColorRGBA.White)){
             playAppleSound();
             this.score += 5;
             this.speed /= 2;
             isPowerUp = true;
             Main.removeApple((int)this.head.x, (int)this.head.y);                
         }
         else if(colors[(int)this.head.x][(int)this.head.y].equals(ColorRGBA.Yellow)){
             playMirrorSound();
             this.score += 3;
             Main.removeApple((int)this.head.x, (int)this.head.y);                
             Main.app.startMirrorMode();
             isPowerUp = true;
         }else if(colors[(int)this.head.x][(int)this.head.y].equals(ColorRGBA.Green)){
              Main.app.gameOver();
         }else{
             this.snake.pop();            
         }
     }else{            
         this.snake.pop();            
     }            
    

    }

}
[/java]