How to set mouse position?

I was wondering if there’s a way to set javas mouse cursor position besides Toolkit. Toolkit does not work on a number of portable PC’s I’ve tested.

By toolkit do you mean java.awt.Robot ? That seems to work pretty well on the 3 major OSs.

Kev

Yes. But not on a 3 different portables running windows XP :slight_smile:
The Robot call simply does nothing.

Coo, on which platform. I wrote a mouse look bit of code a while ago that used the Robot to reset the mouse cursor and it happily worked on a few flavours of linux, windows and I think MacOSX(?).

What version of Java is this in btw, maybe its a(nother) breakage for 1.5?

Kev

Actually it’s 1.4.2 so it’s quite strange. I’ll try to test with 1.5 later :slight_smile:

Perhaps a problem with the security permissions?
Moving the pointer could easily be used to nefarious effect.

Although, looking at the javadoc implies that if you have created the Robot succesfully, there are no more security concerns…

Indeed. Java 1.5 fixes the problem with the portables.