--- 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.
--- 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 "Finder" ); s.atMouse( ), s.atMouse( ).right( 500));
I made this test on my OSX 10.7.5 and had no problem moving the window 500 to the right:
App.focus(
s.wait(1f);
s.click(new Location(200,50));
s.dragDrop(
--- you might try: focus(" BattleNations" ); focusedWindow( ).click( ); // should click the centre of the window mouseDown( Button. LEFT); hover(s. atMouse( ).above( 100));
Screen s = new Screen();
App.
App.
s.wait(0.,5)
s.
s.wait(0.5);
s.
s.mouseUp();
might be that your GUI interprets the mouseDown() immediately after the click as part of a doubleClick.