Tuesday, June 22, 2010

Get mouse pointer position in gwt

int mouseX;
int mouseY;
           

Event.addNativePreviewHandler(new NativePreviewHandler() {
                public void onPreviewNativeEvent(NativePreviewEvent event) {
                    if (event.getNativeEvent().getType().equals("mousemove")) {
                        mouseX = event.getNativeEvent().getClientX();
                        mouseY = event.getNativeEvent().getClientY();
                    }
                }
});

No comments:

Post a Comment