Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.JToggleButton;
- import java.awt.event.ActionListener;
- import java.awt.event.InputEvent;
- import java.awt.event.ActionEvent;
- public class ac extends JFrame {
- private JPanel contentPane;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- ac frame = new ac();
- frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the frame.
- * @return
- */
- public void AutoClicker(){
- try {
- Robot r = new Robot();
- r.mousePress(InputEvent.BUTTON1_DOWN_MASK);
- r.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
- Thread.sleep(100);
- Thread.interrupted();
- } catch (AWTException e) {
- e.printStackTrace();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- public ac() {
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setBounds(100, 100, 450, 300);
- contentPane = new JPanel();
- contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
- setContentPane(contentPane);
- contentPane.setLayout(null);
- JToggleButton tb = new JToggleButton("\u0432\u043A\u043B\\\u0432\u044B\u043A\u043B");
- tb.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- while(tb.isEnabled())
- while(){
- new AutoClicker();
- }
- }
- });
- tb.setBounds(42, 48, 121, 23);
- contentPane.add(tb);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement