Possible Duplicate:
How can I detect if caps lock is toggled in Swing?
How to detect ( method to know ) whether the capslock is on or not in java application because I wants to see to user when user enter password in my application.
boolean state= Toolkit.getDefaultToolkit()
.getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
boolean capsIsOn = Toolkit.getDefaultToolkit().
getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With