title: Robot.mouseMove not moving to specified location properly
body: <p>Whenever I run a <code>mouseMove</code> command for a robot, the mouse doesn't always go to the same location. For example, I have the following code:</p>
  
  <pre><code>import java.awt.Robot;
  import java.util.concurrent.TimeUnit;
  
  public class MainBot {
      public static void main(String[] args){
          try {
              Robot screenWin = new Robot();
              TimeUnit.SECONDS.sleep(2);
              screenWin.mouseMove(100, 300);
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>The code usually makes the mouse end up at the X:</p>
  
  <p><a href="https://i.stack.imgur.com/6Pomw.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6Pomw.png" alt="Mouse Location after running"></a>
  First, I hit run (I am using eclipse) and move my mouse to a location (before the 2 second timer is up). Then the 2 second delay finishes and the mouse moves and then the script ends. The problem is, the mouse never seems to go to the same exact place twice. For example, the mouse should go to <code>(100, 300)</code> but it goes to something that looks like <code>(0, 300)</code> most of the time. Other times, however, if I move the mouse at the beginning to where it should roughly be, then it goes to the right spot. </p>
  
  <p>I am getting where the mouse should be using Paint to get the pixel location of a screenshot but I don't think it is that because the location keeps changing.</p>
  
  <p>Is there anything I'm missing how the coordinates for <code>mouseMove</code> work? </p>
  
  <p><strong>Edit:</strong> Basically, I hit start with that program, then I move the mouse to a new position (so there is a different initial position before the <code>mouseMove</code> function) and then <code>mouseMove</code> executes. Each time I do this, the mouse goes to a different location.</p>