SimpleJMEApplet and AbsoluteMouse

Hi everybody,



I'm having a problem with AbsoluteMouse in combination with SimpleJMEApplet. When I move my mouse from left to right everything happens as expected but when i move my mouse up and down it the cursor moves inverted. If I move my mouse down I can see the ingame cursor go up. Does anyone have a solution or workaround to this problem? I really need AbsoluteMouse because I want to use picking.



I used the TestAbsoluteMouse.java file for testing this problem. I only made a few changes to the code so that it would work inside the applet.



package mousetest;

import com.jme.app.SimpleGame;
import com.jme.image.Texture;
import com.jme.input.AbsoluteMouse;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.Text;
import com.jme.scene.state.AlphaState;
import com.jme.scene.state.TextureState;
import com.jme.util.TextureManager;
import com.jmex.awt.applet.SimpleJMEApplet;

public class Main extends SimpleJMEApplet {

    private Text text;
    private AbsoluteMouse mouse;

    public void simpleAppletUpdate() {
        text.print("Position: " + mouse.getLocalTranslation().x + " , " + mouse.getLocalTranslation().y);
    }

    public void simpleAppletSetup() {
        getLightState().setEnabled(false);
        getRenderer().setBackgroundColor(ColorRGBA.blue);
        mouse = new AbsoluteMouse("Mouse Input", getWidth(), getHeight());
        TextureState cursor = getRenderer().createTextureState();
        cursor.setEnabled(true);
        cursor.setTexture(
                 TextureManager.loadTexture(
                       Main.class.getClassLoader().getResource("jmetest/data/cursor/test.PNG"),
                     Texture.MM_LINEAR, Texture.FM_LINEAR)
               );
        mouse.setRenderState(cursor);
        mouse.registerWithInputHandler( getInputHandler() );

        text = new Text("Text Label","Testing Mouse");
        text.setLocalTranslation(new Vector3f(1, 60, 0));
        TextureState ts = getRenderer().createTextureState();
        ts.setEnabled(true);
        ts.setTexture(
            TextureManager.loadTexture(
                Main.class.getClassLoader().getResource("jmetest/data/font/font.png"),
                Texture.MM_LINEAR,
                Texture.FM_LINEAR));
        text.setRenderState(ts);
        AlphaState as1 = getRenderer().createAlphaState();
        as1.setBlendEnabled(true);
        as1.setSrcFunction(AlphaState.SB_ONE);
        as1.setDstFunction(AlphaState.DB_ONE_MINUS_SRC_COLOR);
        as1.setTestEnabled(true);
        as1.setTestFunction(AlphaState.TF_GREATER);
        text.setRenderState(as1);
        mouse.setRenderState(as1);
        getRootNode().attachChild(text);
        getRootNode().attachChild(mouse);
    }
}