Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Robot;
- import java.awt.event.InputEvent;
- public class ClickClass {
- public static void main(String[] args) throws Exception {
- Robot robot = new Robot();
- int breite = 300;
- int hoehe = 500;
- robot.mouseMove(breite, hoehe);
- // Links-Click
- int wieOft = 30; // klickt 30 mal
- while(wieOft > 0) {
- robot.mousePress(InputEvent.BUTTON1_MASK);
- robot.mouseRelease(InputEvent.BUTTON1_MASK);
- try {
- Thread.sleep( 200 ); // klickt alle 200 ms
- System.out.println( "Zeit ist um." );
- } catch ( InterruptedException e ) { e.printStackTrace(); }
- wieOft--;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement