No description
Find a file
2026-07-12 13:48:13 +02:00
.idea init 2026-07-12 13:48:13 +02:00
src/main/java/clicker init 2026-07-12 13:48:13 +02:00
.gitignore init 2026-07-12 13:48:13 +02:00
dependency-reduced-pom.xml init 2026-07-12 13:48:13 +02:00
features.md init 2026-07-12 13:48:13 +02:00
pom.xml init 2026-07-12 13:48:13 +02:00
README.md init 2026-07-12 13:48:13 +02:00

Java Auto Clicker

A configurable auto-clicker desktop application built with Java Swing. Automatically clicks the mouse at the current cursor position with a wide range of customizable parameters.

Prerequisites

  • Java 17 or later
  • Maven 3.6+ (for building)

Building

mvn clean package

This produces a fat JAR at target/AutoClicker.jar with all dependencies bundled.

Running

java -jar target/AutoClicker.jar

Features

Feature Description
Click interval Min/max delay between clicks (1ms 1 hour)
Random jitter Clicks scattered within a configurable pixel radius
Mouse button Left, Right, or Middle
Click type Single or Double click
Stop conditions Manual, fixed duration, or fixed click count
Start delay 060 second countdown before clicking begins
Global hotkeys F11 (start) / F12 (stop) — works in any window
Always-on-top Toggle to keep window above others
Live stats Real-time click count, elapsed time, and CPS
Multi-monitor Automatically spans all connected displays

Hotkeys

Key Action
F11 Start clicking
F12 Stop clicking

These hotkeys work globally, so you can switch to any other window before pressing them.

Configuration Options

Click Timing

  • Min time between clicks — Minimum delay in milliseconds before the next click
  • Max time between clicks — Maximum delay in milliseconds; actual delay is randomly sampled from [min, max]
  • Random position radius — Pixel radius around the anchor point; 0 means exact same spot every time

Click Type

  • Mouse button — Which button to click (Left / Right / Middle)
  • Click type — Single click or double click

Stop Condition

  • Run until stopped — Clicks until you press F12 or the Stop button
  • Stop after fixed duration — Stops after the specified number of seconds
  • Stop after fixed number of clicks — Stops after the specified click count
  • Start delay — Seconds to wait before clicking begins (gives you time to position the cursor)

Project Structure

autoClicker/
├── pom.xml
├── features.md
├── README.md
└── src/main/java/clicker/
    ├── AutoClickerApp.java    # Entry point
    ├── MainFrame.java         # Swing UI and event wiring
    ├── ClickEngine.java       # Core clicking logic (thread, Robot)
    ├── ClickConfig.java       # Immutable configuration record
    ├── ClickStatistics.java   # Runtime statistics tracker
    ├── ClickListener.java     # Callback interface for engine events
    └── HotkeyManager.java     # Global hotkey registration

Architecture

The application is split into focused classes:

  • AutoClickerApp — Entry point; sets up look-and-feel and launches the window
  • MainFrame — Swing UI frame; builds all panels, handles user input, and wires everything together
  • ClickEngine — Pure clicking logic; manages the background thread, Robot interaction, and random position computation with no UI dependencies
  • ClickConfig — Java record holding all session configuration with typed enums for button, click type, and stop condition
  • ClickStatistics — Thread-safe tracker for click count, elapsed time, and clicks per second
  • ClickListener — Callback interface that keeps ClickEngine decoupled from Swing
  • HotkeyManager — Wraps JNativeHook for global F11/F12 keyboard capture

Dependencies

Library Version Purpose
JNativeHook 2.2.2 Global keyboard hooks for F11/F12

License

This project is open source. See the repository for license details.