title: How can I simulate a mousePressed event without using java.awt.robot?
body: <p>I want to simulate a mousePressed event in Java, I found out that I can use the <code>Robot</code> class for this, and it works, but only in Windows and not in Mac OS X.</p>
  
  <p>Does anyone know of an alternative way to simulate a <code>mousePressed</code> event?</p>
  
  <p>This is the code I used:</p>
  
  <pre><code>Robot robot = new Robot();
  robot.mousePress(InputEvent.BUTTON1_MASK);
  </code></pre>