title: How to have mouseEntered execute only if mouse is pressed down in Java
body: <p>I Want to execute the mouseEntered only IF the mouse is currently pressed down, basically this:</p>
  
  <pre><code>    @Override
      public void mouseEntered(MouseEvent e) {
         if(e.mouseDown()){
           //Do stuff
          }
      }
  </code></pre>
  
  <p>can I do it like this, or do I need a mouse motion listener or what?</p>
  
  <p>Thanks! </p>
  
  <p>EDIT: Sorry should have made this more clear, but I need the mouse to be press down Before it enters the component, its like holding down the mouse and hovering over the component activates the listener</p>