多个单选组为每个组的每个单选按钮提供键盘快捷键 [英] multiple radio group give short cut key in keyboard for each radio button for each group java swing

查看:56
本文介绍了多个单选组为每个组的每个单选按钮提供键盘快捷键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有许多无线电组,每个组都有许多单选按钮,我想知道如何为每个按钮分配一个键盘快捷键或键盘快捷键的组合,例如我想放置第一组第一个单选按钮中的数字 1 所以如果我选择第一组并在键盘上自动按 1 将选择第一个单选按钮.我现在通过选项卡进行操作,当我使用选项卡时,我选择了焦点单选按钮,但是当有这么多单选按钮时这并不好,因为如果我使用选项卡直到最后一个单选按钮需要时间.这怎么可能接受任何建议

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

推荐答案

参见 AbstractButton.setMnemonic(char).

我的坏...

此方法现已过时,请使用 setMnemonic(int) 设置按钮的助记符.

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

这篇关于多个单选组为每个组的每个单选按钮提供键盘快捷键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆