Results 1 to 3 of 3
  1. #1
    CoolLove is offline Member
    Join Date
    Dec 2008
    Posts
    1
    Rep Power
    0

    Red face Java Robot commands not working

    Hello,

    can someone help me, please?
    the java robot and mousePress commands do not work.
    Could someone show me one single java applet source code which WORKS?

    My java complier javac successfully compiles the source codes and the applets start successfully in my browser, but it still does not work because the java is not clicking anywhere on the screen and it is not moving the mouse.
    the robot.mouseMove(200,2) and robot.mousePress commands do not work yet?
    What is wrong?
    I have Windows XP.
    mouseMove(200,2) is not working either. and mousePress command (without the robot.) is not working either.


    Please help.
    Please please please.
    here are the not working source codes:
    The URLs are:
    qwertzuioasdfghjk.netfirms.com/rhlu.java
    qwertzuioasdfghjk.netfirms.com/rhbsgi.java
    qwertzuioasdfghjk.netfirms.com/RobotExp.java

    does it need the init() command somewhere? if yes, where and how?

  2. #2
    neilcoffey is offline Senior Member
    Join Date
    Nov 2008
    Posts
    286
    Rep Power
    6

    Default

    Robot sounds like the kind of thing I wouldn't expect the security manager to let you use from a non-signed applet. Does your code work in a standalone application?

  3. #3
    darrenabc is offline Member
    Join Date
    Jan 2009
    Posts
    5
    Rep Power
    0

    Default

    import java.awt.*;
    import java.awt.event.InputEvent;

    import java.util.*;
    class BluetoothMouseController{
    public static void main(String[] args){
    int x=0;
    int y=0;
    Point CurrentPosition=CurrentMouseCursor();

    x=(int)CurrentPosition.getX();
    y=(int)CurrentPosition.getY();

    try{
    Robot rob=new Robot();
    rob.mouseMove(x+dx,y+dy);
    }
    catch(AWTException e){
    System.err.println("Caught AWTException: "+ e.getMessage());
    }
    }
    }

Similar Threads

  1. Newbie - Robot Class
    By drasgear in forum New To Java
    Replies: 2
    Last Post: 11-14-2008, 05:46 PM
  2. Capturing video with Robot
    By russ2620 in forum AWT / Swing
    Replies: 0
    Last Post: 06-03-2008, 05:49 PM
  3. Replies: 8
    Last Post: 05-28-2008, 08:00 AM
  4. Robot Class
    By Jessie Madman in forum New To Java
    Replies: 3
    Last Post: 05-15-2008, 05:13 AM
  5. Robot Class
    By jfredrickson in forum New To Java
    Replies: 2
    Last Post: 07-11-2007, 10:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •