Example usage for javax.swing JRadioButtonMenuItem getAccessibleContext

List of usage examples for javax.swing JRadioButtonMenuItem getAccessibleContext

Introduction

In this page you can find the example usage for javax.swing JRadioButtonMenuItem getAccessibleContext.

Prototype

@BeanProperty(bound = false)
public AccessibleContext getAccessibleContext() 

Source Link

Document

Gets the AccessibleContext associated with this JRadioButtonMenuItem.

Usage

From source file:edu.ku.brc.ui.UIHelper.java

/**
 * Creates a JRadioButtonMenuItem.//from   w w w .  j  ava 2 s  .  c  o  m
 * @param menu parent menu
 * @param label the label of the menu item
 * @param mnemonic the mnemonic
 * @param accessibleDescription the accessible Description
 * @param enabled enabled
 * @param action the aciton
 * @return menu item
 */
public static JRadioButtonMenuItem createRadioButtonMenuItem(final JMenu menu, final String label,
        final String mnemonic, final String accessibleDescription, final boolean enabled,
        final AbstractAction action) {
    JRadioButtonMenuItem mi = new JRadioButtonMenuItem(getResourceString(label));
    if (menu != null) {
        menu.add(mi);
    }
    setLocalizedMnemonic(mi, mnemonic);
    if (isNotEmpty(accessibleDescription)) {
        mi.getAccessibleContext().setAccessibleDescription(accessibleDescription);
    }
    if (action != null) {
        mi.addActionListener(action);
        action.addPropertyChangeListener(new MenuItemPropertyChangeListener(mi));
        action.setEnabled(enabled);
    }

    return mi;
}