!752 p { substance(); swingAndWait(r { JFrame frame = showFrame(); frame.setBounds(0, 0, 400, 400); }); Point a = new Point(50, 10), b = new Point(150, 10); final new Robot robot; sleep(1000); robot.mouseMove(a.x, a.y); final int button = InputEvent.BUTTON1_DOWN_MASK; robot.mousePress(button); sleep(500); robot.mouseMove(b.x, b.y); robot.mouseRelease(button); }