Is there a way to stop the Robot class after it has started
问题 Is there a way to stop Java Robot execution once it's started? I have a program that simulates left mouse button clicks, but i also have an unused JButton named STOP that was supposed to stop this clicking that i started using the Robot class. I noticed that Robot is fairly harder than the Thread class. Any ideas? import java.awt.AWTException; import java.awt.Robot; import java.awt.event.InputEvent; import java.util.Random; public class Click{ Robot robot = new Robot(); private void leftClick