When i run my autoclicker i cant stop it : If i click on start button i cant click back or stop.
I need stop app.One way to stop app is that you must power off computer :D.
When app is running start button is locked and i cant click on it.
This app is simple AutoClicker.
Exist in java something better to do autoclicker than robot class?
How can i fix it?
Is somewhere error?
Or something to stop  the app?



       import java.awt.AWTException;
       import java.awt.BorderLayout;
       import java.awt.EventQueue;
       import java.awt.Robot;
       import javax.swing.JFrame;
       import javax.swing.JPanel;
       import javax.swing.border.EmptyBorder;
       import javax.swing.JCheckBox;
       import javax.swing.JLabel;
       import java.awt.event.ActionListener;
       import java.awt.event.ActionEvent;
       import java.awt.event.KeyEvent;
       import java.awt.event.MouseEvent;
       import java.awt.Color;


public class AutoClicker extends JFrame {

	private JPanel contentPane;
	private final JLabel m = new JLabel("AutoClicker");

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					AutoClicker frame = new AutoClicker();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public AutoClicker() {
		
		setAlwaysOnTop(false);
		setTitle("AutoClicker");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 147, 162);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JCheckBox chckbxOnTop = new JCheckBox("On Top");
		 boolean onTop = false;
		chckbxOnTop.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				if(chckbxOnTop.isSelected()){
					setAlwaysOnTop(true);
				}
				else{
					setAlwaysOnTop(false);
				}	
				
			}
		});
		chckbxOnTop.setBounds(6, 7, 97, 23);
		contentPane.add(chckbxOnTop);
		
	
		
		
		JCheckBox chckbxAutoclicker = new JCheckBox("AutoClicker");
		chckbxAutoclicker.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				for(;;){
					if(chckbxAutoclicker.isSelected()){
						for(;;){
							try {
								Robot r = new Robot();
								r.mousePress(MouseEvent.BUTTON1_MASK);
								r.setAutoDelay(1080);
								r.mouseRelease(MouseEvent.BUTTON1_MASK);
							} catch (AWTException e1) {
								
								e1.printStackTrace();
							}
							
						}
					}
					else {
						
					}
				}
			}
		});
		chckbxAutoclicker.setBounds(6, 80, 97, 23);
		contentPane.add(chckbxAutoclicker);
		m.setForeground(new Color(153, 102, 0));
		m.setBounds(16, 92, 120, 31);
		contentPane.add(m);
	}
}
