Move cursor in the desktop and click in fedora

Can you give me idea on how to control/control the mouse. I have application to choose in the desktop and then click.
thanks for you help.
randylPalomoAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
CEHJConnect With a Mentor Commented:
See java.awt.Robot
0
 
objectsCommented:
Robot r = new Robot();
r.mouseMove(100, 100);
r.mousePress(0);
r.mouseRelease(0);

0
 
DrWarezzCommented:
It's easy to move the pointer, but you'll need to use JNI to simulate a 'click' of the mouse (and won't be easy) - [AFAIK].

Moving the cursor: http://www.javaalmanac.com/egs/java.awt/MoveMouse.html

JNI tutorial: http://java.sun.com/docs/books/tutorial/native1.1/

Best of luck,
[r.D]
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
DrWarezzCommented:
>"Robot r = new Robot();
   r.mouseMove(100, 100);
   r.mousePress(0);
   r.mouseRelease(0);"

Can't the mouse click only be done using java (without JNI) on your own application? I didn't know that it could be used anywhere on the screen .... ?

[r.D]
0
 
randylPalomoAuthor Commented:
Thanks guys, sorry for I just now replied, internet problem. anyway I got it when CEHJ send the idea. but my problem now is when im set in the crontab. I made a testing, it copy a file but when I run the java program it won't work.
0
 
CEHJCommented:
:-)

What do you mean by 'it won't work'?
0
 
randylPalomoAuthor Commented:
hello,
   I tried to run automatically at given time in my computer "linux" without using any timer program in java. So I set-up the crontab, call a script that run the java program but it didn't work. I ran the script indipendently and it works. So I test my crontab if its work, I add a new crontab that will call a script and the script will only copy a file in other directory. And it work, but the script that call java it will not work. Anyway I just did the timer program but untill now I still don' t why my first option did not work "Calling a script that runs java  program and assign in the crontab".
thanks
0
All Courses

From novice to tech pro — start learning today.