title: In Java, how do I find the time since the last mouse moved?
body: <p>Say, for example, if I have a circle drawn in a JFrame, and I want to paint over it if I hover over it for three seconds.</p>
  
  <p>I've got a MouseMotionListener that tells me the point of the cursor in the JFrame, but so far that's about it.</p>
  
  <pre><code>public void mouseMoved(MouseEvent e)
  {
    PointerInfo a = MouseInfo.getPointerInfo();
    cursorPos = a.getLocation();
    SwingUtilities.convertPointFromScreen(cursorPos, e.getComponent());
  }
  </code></pre>
  
  <p>I'm still quite new to action listeners. What should I add if I want to test if the mouse is <i>not</i> moving?</p>
  
  <p>Also, I'm just curious, why is it that <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/event/MouseEvent.html#MOUSE_MOVED" rel="nofollow">MOUSE_MOVED</a> in MouseEvent is considered an int? </p>