code: private void updateCoord(MouseEvent event)
      {
          oldX = x;
          oldY = y;
          x = event.getXOnScreen();
          y = event.getYOnScreen();
          wx = event.getX();
          wy = event.getY();
          mx = x - oldX;
          my = y - oldY;
      }
docs: Update coordinate from event.
  
  @param event event consumed.