How to write an auto clicker in Java

preview_player
Показать описание
After my kid asked me to download and install an auto-clicker, I saw this as a teachable moment to build one in Java. I could talk about the different concepts Java offers and also explore a new API in the Java API.

Write up with source code:

Leverage AI in your software development workflow. Enhance your skills as a software developer, grow your career, and stay competitive in this fast-paced industry.

Cyber Security. An introduction to modern information and system protection technology and methods.

Support the channel and donate a coffee:

Or visit my blog at:

Outro music: Sanaas Scylla

#java #robot #autoclicker
Рекомендации по теме
Комментарии
Автор

“With great power comes great responsibility”

iamtheskywalker
Автор

Why can't I find "Robot java.awt" at my java program as a default? I have never learned programming, and just following YouTube. Please be kind to let me know the reason.

CGBy
Автор

I always forget about the Robot class in Java. We've used it at work a couple of times when building our test automation framework, which is mainly based on Selenium. I think we may have used it to dismiss browser alert dialogs that Selenium can't interact with on its own.. I haven't really looked at that code recently, so I don't recall.

One thing that might be interesting is if you can show (assuming it's possible, again I haven't really looked into it) how you might programmatically identify the location of something on the screen to click on it. If I'm not mistaken, your example here requires the user to manually position the mouse cursor over the button to be auto-clicked. If the code is able to find the button on its own, that would be really cool :)

There might be challenges with that, though, given it's Java running a "platform-independent" VM, so perhaps it's not able to see the other things that are running. Or if there is a solution, it might require a different approach/API for Windows, Linux, Mac, etc. Anyway, just an idea...

aaronperl
Автор

hello.... i copied the code and paste it in visual code and saved as .java now how do i open it when i click open with.. it tells me to open with either notepad or visual code studio plz help

smokblade
Автор

Is there any way of making it click at a random time within a certain interval, let's say 1400 - 1600 milliseconds?

busenberlin
Автор

Hey if i were to copy this code what button would i have to press to activate it? Or does it run while its open

CadenMTB
Автор

i tried using inspect and bookmark, it does not work! Why is the cause?

Stevenonyoutube
Автор

how could I implement a key listener so that it becomes toggleable?

seebobeebo
Автор

Hi,
but i wanna affect only one program->file, no all active programs
is this possible in Robot Class?

appchild
Автор

What is the difference between the public and published access modifier?

johnymadrita
Автор

your son needs an autoclicker for what? Growtopia?

FootClob
join shbcf.ru