title: How to smoothly move mouse cursor with Java?
body: <p>I'm trying to use the Robot class to move the mouse pointer based on accelerometer readings I'm getting from my android device via bluetooth. The problem is that the mouse cursor moves in steps. I need a way to move it smoothly, like physically dragging the pointer. Here's what I have so far</p>
  
  <pre><code>@Override
  public void serialEvent(SerialPortEvent serialPortEvent) {
          if(serialPortEvent.getEventType() == SerialPortEvent.DATA_AVAILABLE) {
              try {
                  String inputLine = input.readLine();
                  String[] values = inputLine.split(",");
                  int x = Integer.parseInt(values[0])*(-1);
                  int y = Integer.parseInt(values[1])*(-1);
                  mouse.moveMouse(x, y);
                  //System.out.println(inputLine);
              } catch (IOException e) {
                  System.err.println(e.toString());
              }
          }
  }
  </code></pre>
  
  <p>Here the mouse pointer moves in smaller or bigger steps depending on how much the phone is tilted. But I want it to move faster or slower. </p>