title: java.awt.Robot is not functioning as expected
body: <p>I have the following code:</p>
  
  <pre><code>autoPlay = new Robot();
  autoPlay.setAutoDelay(500);
  autoPlay.mouseMove((game.getLocationOnScreen().x + 1), (game.getLocationOnScreen().y + 1));
  autoPlay.mousePress(InputEvent.BUTTON1_DOWN_MASK);
  autoPlay.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
  autoPlay.mouseMove((game.getLocationOnScreen().x + 381), (game.getLocationOnScreen().y + 1));
  autoPlay.mousePress(InputEvent.BUTTON1_DOWN_MASK);
  autoPlay.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
  autoPlay.mouseMove((game.getLocationOnScreen().x + 1), (game.getLocationOnScreen().y + 381));
  autoPlay.mousePress(InputEvent.BUTTON1_DOWN_MASK);
  autoPlay.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
  autoPlay.mouseMove((game.getLocationOnScreen().x + 381), (game.getLocationOnScreen().y + 381));
  autoPlay.mousePress(InputEvent.BUTTON1_DOWN_MASK);
  autoPlay.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
  autoPlay.mouseMove(currentX, currentY);
  </code></pre>
  
  <p>According to the code, the robot should move to the top left corner of a JPanel that I have called <code>game</code>. Then it should press and release the left mouse button. Then it should move to the top right corner and press/release the left mouse button. Then it should move to the bottom left corner and press/release the left mouse button. Then it should move to the bottom right corner and press/release the right mouse button. Finally, it should move back to the top left corner. </p>
  
  <p>However, what is happening is that the Robot moves to the corners but doesn't click. It only clicks once when it moves back to the top left corner at the end of the code. I am wondering if my JDK/SDK is the source of the problem or if I don't understand the Robot class. </p>