Unexpected mouse behaviour in Appletviewer

Ok, so I’m attempting a game for the 4k, but having a bit of a strange bug reading the mouse co-ords.

At the moment I’m just drawing a sprite at the mouse coords and noticing that in Appletviewer the location is way off, by as much as 200-300 pixels. It’s not constant either, as if I move or resize the window, the offset changes.

It works as expected when viewing in a browser… the sprite sits nicely under the mouse pointer.

Like many of the 4k games I’m just overriding handleEvent and getting the mousex,mousey that way

 public boolean handleEvent(Event e) 
    {
        switch (e.id) 
        {
          ...keyboard and other stuff here...

            case Event.MOUSE_MOVE:
            case Event.MOUSE_DRAG:
                mousex = e.x;
                mousey = e.y;
                break;
        }
        return false;
    }

I also noticed that quite a few of the 4k games which use mouse control also are way off when opened using AppletViewer.

This is annoying mainly because it’s quicker to fire up AppletViewer when debugging than to open a browser and wait for the JRE plugin to init.

Should I be modifying mousex and mousey to take anything else into account (like window position)?

D