简体   繁体   中英

JFrame listening for KeyEvent while Iconified

How can I keep my JFrame listening for KeyEvent while its state is iconified?

For example after pressing F1 to start the program (an auto clicker) and iconify the frame (remember that because of the click the focus on the frame is lost!) :)

If you're trying to create a key-logger program with Java, don't. It's not a good tool for creating this since it by design is isolated from the OS, in other words it's "OS-agnostic". You will need to use a different tool for your allegedly nefarious plans such as C or C++ since these languages allow you to get closer to the "metal".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM