Reputation: 4305
I have a JDialog
with two buttons: an OK button and a Cancel button.
I would like the Cancel button to be activated by pressing Esc and an OK to be activated by pressing Return. Can someone give me some suggestions for implementing this feature? Thanks!
Upvotes: 3
Views: 1043
Reputation: 44250
The verb "activate" is ambiguous. But regardless, I suggest you read How to Use Key Bindings.
Upvotes: 4