Comment 2 for bug 1262394

Revision history for this message
RaiMan (raimund-hocke) wrote : Re: Java dragDrop not working

--- Usage in Netbeans not as recommended (nothing to do with the problem)
It is recommended, that you do not move around copies of the Sikuli stuff. In your Netbeans project, you should use references to the sikuli jar, that resides in the setup folder.
This would eliminate the error message at the beginning, since the libs folder will be permanent after the first run.
In your case the dist folder is rebuilt from time to time and hence the libs folder has to be created newly and the libs exported from the jar.

-- Region or Screen does not matter
all mouse, keyboard, search, ... functions are Region functions and inherited by Screen objects (Screen extends Region).
furthermore all preliminaries with a click, hover or other high level mouse actions finally result in a point on a physical screen, that is used by the respective series of mouse functions processed by the Java AWT Robot deep down internally.

-- does not work on Finder windows
I made this test on my OSX 10.7.5 and had no problem moving the window 500 to the right:
  App.focus("Finder");
  s.wait(1f);
  s.click(new Location(200,50));
  s.dragDrop(s.atMouse(), s.atMouse().right(500));

--- you might try:
    Screen s = new Screen();
     App.focus("BattleNations");
     App.focusedWindow().click(); // should click the centre of the window
     s.wait(0.,5)
     s.mouseDown(Button.LEFT);
     s.wait(0.5);
     s.hover(s.atMouse().above(100));
     s.mouseUp();

might be that your GUI interprets the mouseDown() immediately after the click as part of a doubleClick.