开发者

Activating a JButton via keyboard

I have a JDialog with t开发者_如何学编程wo 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!


The verb "activate" is ambiguous. But regardless, I suggest you read How to Use Key Bindings.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜