Solved

Move cursor in the desktop and click in fedora

Posted on 2004-10-26
201 Views
Last Modified: 2010-03-31
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.
0
Question by:randylPalomo
    8 Comments
     
    LVL 86

    Accepted Solution

    by:
    See java.awt.Robot
    0
     
    LVL 92

    Expert Comment

    by:objects
    Robot r = new Robot();
    r.mouseMove(100, 100);
    r.mousePress(0);
    r.mouseRelease(0);

    0
     
    LVL 9

    Expert Comment

    by:DrWarezz
    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
     
    LVL 9

    Expert Comment

    by:DrWarezz
    >"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
     
    LVL 92

    Expert Comment

    by:objects
    0
     

    Author Comment

    by:randylPalomo
    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
     
    LVL 86

    Expert Comment

    by:CEHJ
    :-)

    What do you mean by 'it won't work'?
    0
     

    Author Comment

    by:randylPalomo
    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    sum67 challenge 35 68
    maxMirror challenge 10 50
    Return ZipOutputStream using Servlet 2 18
    Enhanced For loop vs ForEach Loop 4 28
    Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Video by: Michael
    Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

    934 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now