title: How can java.awt.Robot be made to respond to mouse drag events?
body: <p>I'm writing a class that will allow users on other computers to control the contents of a JPanel, for use in a shared display system.  java.awt.Robot will allow me to perform mouse clicks and keyboard input, but it does not have a <code>mouseDragged(MouseEvent evt)</code> method. My client has <code>clientMouseReleased</code> (and <code>Pressed</code>) methods as part of a <code>MouseAdapter</code> listener that look like:</p>
  
  <pre><code>private void clientMouseReleased(java.awt.event.MouseEvent evt)
  {
      try
      {
          switch (evt.getButton())
          {
              case 1:
                  remoteDesktop.mouseRelease(evt.getX(), evt.getY(), InputEvent.BUTTON1_MASK);
                  break;
              case 2:
                  remoteDesktop.mouseRelease(evt.getX(), evt.getY(), InputEvent.BUTTON2_MASK);
                  break;
              case 3:
                  remoteDesktop.mouseRelease(evt.getX(), evt.getY(), InputEvent.BUTTON3_MASK);
                  break;
          }
      }
      catch (Exception e)
      {
          e.printStackTrace();
          JOptionPane.showMessageDialog(this, e.getMessage());
      }
  }
  </code></pre>
  
  <p>Where the <code>remoteDesktop</code> is a class containing a java.awt.Robot, and it executes a <code>Robot.mouseMove</code> and <code>Robot.mouseRelease</code> (or <code>Robot.mousePress</code>) in the method the client calls. I'd like to be able to write the <code>mouseDragged</code> in the same way, i.e., like this:</p>
  
  <pre><code>private void clientMouseDragged(java.awt.event.MouseEvent evt)
  {
      try
      {
          switch (evt.getButton())
          {
              case 1:
                  remoteDesktop.mouseDragged(evt.getX(), evt.getY(), InputEvent.BUTTON1_MASK);
                  break;
              case 2:
                  remoteDesktop.mouseDragged(evt.getX(), evt.getY(), InputEvent.BUTTON2_MASK);
                  break;
              case 3:
                  remoteDesktop.mouseDragged(evt.getX(), evt.getY(), InputEvent.BUTTON3_MASK);
                  break;
          }
      }
      catch (Exception e)
      {
          e.printStackTrace();
          JOptionPane.showMessageDialog(this, e.getMessage());
      }
  }
  </code></pre>