I'm going to reimplement numpad (Somewhat similar to calculator pane) inside a SWING application. It must respond on both numkeys (numlock section) and numeric keys (right below function keys). The current solution captures the input for the whole frame and requests focus after each action. I found this solution clumsy and want to use the SWING Action
s. But, it's quite tricky to make it work for both different keys.
- Could it be done?
- How to make in the most elegant and performance effective way?
Asked
Active
Viewed 16 times
1

ppopoff
- 658
- 7
- 17
-
[Key Bindings](https://docs.oracle.com/javase/tutorial/uiswing/misc/keybinding.html) – Hovercraft Full Of Eels Jan 18 '18 at 17:18
-
See the `Calculator Panel` example in: https://stackoverflow.com/questions/35906270/how-to-put-actionlistenerand-actioncommand-to-multiple-jbuttons/35906545#35906545 for a working example that uses Key Bindings to bind both keys to the same Action. – camickr Jan 18 '18 at 17:20