Mouselook within a J3D applet

Got the mouselook code working. Pressing m on the keyboard hides the cursor and moving the mouse pans the camera. Pressing m again returns the cursor to default and turns off the mouselook.

However, move the mouse beyond the edge of the applet and the whole thing stops working properly. So, I want to reset the cursor position in the middle of the applet after every move.

And this is in an applet, so I can’t use Robot!

Has anybody been able to implement a functional mouse look within an applet?

Well if youbuse JInput it doesnt matter where the pointer is, you can always read the mouse.