code: private boolean handleWrapping(MouseEvent e)
      {
          if (robot == null)
          {
              return false;
          }
          PointerInfo pointerInfo = null;
          try
          {
              pointerInfo = MouseInfo.getPointerInfo();
          }
          catch (SecurityException ex)
          {
              return false;
          }
          Rectangle r = 
              pointerInfo.getDevice().getDefaultConfiguration().getBounds();
          Point onScreen = pointerInfo.getLocation();
          if (onScreen.y == 0)
          {
              robot.mouseMove(onScreen.x, r.height-2);
              previousPoint = new Point(onScreen.x, r.height-2);
              SwingUtilities.convertPointFromScreen(previousPoint, spinner);
              return true;
          } 
          else if (onScreen.y == r.height - 1)
          {
              robot.mouseMove(onScreen.x, 1);
              previousPoint = new Point(onScreen.x, 1);
              SwingUtilities.convertPointFromScreen(previousPoint, spinner);
              return true;
          }
          return false;
      }
docs: Let the mouse wrap from the top of the screen to the bottom
  or vice versa
  
  @param e The mouse event
  @return Whether the mouse wrapped