本文整理汇总了Java中javax.swing.JRadioButtonMenuItem.setMnemonic方法的典型用法代码示例。如果您正苦于以下问题:Java JRadioButtonMenuItem.setMnemonic方法的具体用法?Java JRadioButtonMenuItem.setMnemonic怎么用?Java JRadioButtonMenuItem.setMnemonic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JRadioButtonMenuItem
的用法示例。
在下文中一共展示了JRadioButtonMenuItem.setMnemonic方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createButtonGroupMenuItem
import javax.swing.JRadioButtonMenuItem; //导入方法依赖的package包/类
/**
* Create a radio button menu menu item for items that are part of a
* button group.
*
* @param menu the menu
* @param label the label
* @param mnemonic the mnemonic
* @param accessibleDescription the accessible description
* @param action the action
* @param buttonGroup the button group
* @return the j menu item
*/
private JMenuItem createButtonGroupMenuItem(JMenu menu, String label,
String mnemonic,
String accessibleDescription,
Action action,
ButtonGroup buttonGroup) {
JRadioButtonMenuItem mi = (JRadioButtonMenuItem)menu.add(
new JRadioButtonMenuItem(getString(label)));
buttonGroup.add(mi);
mi.setMnemonic(getMnemonic(mnemonic));
mi.getAccessibleContext().setAccessibleDescription(getString(
accessibleDescription));
mi.addActionListener(action);
return mi;
}
示例2: createAudioMenuItem
import javax.swing.JRadioButtonMenuItem; //导入方法依赖的package包/类
/**
* Create the theme's audio submenu.
*
* @param menu the menu
* @param label the label
* @param mnemonic the mnemonic
* @param accessibleDescription the accessible description
* @param action the action
* @return the j menu item
*/
public JMenuItem createAudioMenuItem(JMenu menu, String label,
String mnemonic,
String accessibleDescription,
Action action) {
JRadioButtonMenuItem mi = (JRadioButtonMenuItem) menu.add(new JRadioButtonMenuItem(getString(label)));
audioMenuGroup.add(mi);
mi.setMnemonic(getMnemonic(mnemonic));
mi.getAccessibleContext().setAccessibleDescription(getString(accessibleDescription));
mi.addActionListener(action);
return mi;
}
示例3: createThemesMenuItem
import javax.swing.JRadioButtonMenuItem; //导入方法依赖的package包/类
/**
* Creates a JRadioButtonMenuItem for the Themes menu.
*
* @param menu the menu
* @param label the label
* @param mnemonic the mnemonic
* @param accessibleDescription the accessible description
* @param theme the theme
* @return the j menu item
*/
public JMenuItem createThemesMenuItem(JMenu menu, String label, String mnemonic,
String accessibleDescription, MetalTheme theme) {
JRadioButtonMenuItem mi = (JRadioButtonMenuItem) menu.add(new JRadioButtonMenuItem(getString(label)));
themesMenuGroup.add(mi);
mi.setMnemonic(getMnemonic(mnemonic));
mi.getAccessibleContext().setAccessibleDescription(getString(accessibleDescription));
// mi.addActionListener(new ChangeThemeAction(this, theme));
return mi;
}