multiple radio group give short cut key in keyboard for each radio button for each group java swing

余生长醉 提交于 2019-12-13 03:33:33

问题


I have radio many radio group in my application and each group has many radio button i want to know how it is possible to assign one key board short cut or a combination of keyboard short cut for each button for example i want to put number 1 in first group first radio button so if i select the first group and press 1 in keyboard automatically first radio button will be selected. I am doing it now by tab, when i tab i select the focus radio button but it is not good when there are so many radio button because it takes time if i tab until the last radio button. How is this possible any suggestion is accepted


回答1:


See AbstractButton.setMnemonic(char).

My bad..

This method is now obsolete, please use setMnemonic(int) to set the mnemonic for a button.



来源:https://stackoverflow.com/questions/26964523/multiple-radio-group-give-short-cut-key-in-keyboard-for-each-radio-button-for-ea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!