Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

A fake mouse click

Thread view: 
Nik Belyaev - 31 Jan 2006 12:53 GMT
Hi, All!

I've come across a problem which I've never met before. My program has to
emulate a mouse movement and a mouse click. I.e. I need something like
"mouseMoveTo(int x, y)" and "mouseClick()" that moves the cursor at (x,y)
of the screen and emulates a left click, respectively.

I tried searching for this kind of method in the RTFM but I didn't get any
results...

I'd really appreciate if someone could show me the right way of implementing
this.

PS If it makes it different, the system is Linux with KDE 3.4

Signature

With best regards,
Nik

Benoit Peltier - 31 Jan 2006 17:05 GMT
Have you tried the java.awt.Robot class ?  It seems to have the method you
need.

Benoit

> Hi, All!
>
[quoted text clipped - 11 lines]
>
> PS If it makes it different, the system is Linux with KDE 3.4
Ian Shef - 31 Jan 2006 19:09 GMT
<snip>
> I've come across a problem which I've never met before. My program has
> to emulate a mouse movement and a mouse click. I.e. I need something
> like "mouseMoveTo(int x, y)" and "mouseClick()" that moves the cursor at
> (x,y) of the screen and emulates a left click, respectively.
<snip>
Take a look at java.awt.Robot, available since Java 1.3.
Methods available include mouseMove, mousePress, and mouseRelease.

Signature

Ian Shef     805/F6      *    These are my personal opinions    
Raytheon Company         *    and not those of my employer.
PO Box 11337             *
Tucson, AZ 85734-1337    *

Nik Belyaev - 31 Jan 2006 21:27 GMT
> <snip>
>> I've come across a problem which I've never met before. My program has
[quoted text clipped - 4 lines]
> Take a look at java.awt.Robot, available since Java 1.3.
> Methods available include mouseMove, mousePress, and mouseRelease.

OK, Thanks everybody! This is exactly the kind of class I've been looking
for but somehow couldn't find ;). Thanks again...

Signature

With best regards,
Nik



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.