Java – generate MouseMove event using dispatcher?

Do you use Java awt. Component. DispatchEvent (awtevent) does a MouseMove event?

.dispatchEvent(new MouseEvent(client.a
                           .getComponentAt(1,1),MouseEvent.MOUSE_MOVED,System.currentTimeMillis(),MouseEvent.NOBUTTON,x,y,1,false));

I've got this now, but it doesn't perform mouse movement What shall I do?

Editor: I've tried this, but it doesn't work:

.dispatchEvent(new MouseEvent(client.a
                           .getComponentAt(1,false));

Thank you, Jeffrey

Solution

I know there is no way to do this the way you try, because mouseevent (as far as I know) is used to send mouse messages to components rather than the operating system Usually I use the robot class or JNA to actually move the mouse cursor on the screen

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>