Java Swing Menu createMenu(final String label, final String mnemonic, final String accessibleDescription)

Here you can find the source of createMenu(final String label, final String mnemonic, final String accessibleDescription)

Description

Create a menu.

License

Open Source License

Parameter

Parameter Description
label the label text for the menu.
mnemonic the mnemonic for the menu accelerator.
accessibleDescription the description of the menu for tool tips, etc.

Return

a menu.

Declaration

public static JMenu createMenu(final String label, final String mnemonic, final String accessibleDescription) 

Method Source Code


//package com.java2s;

import javax.swing.JMenu;

public class Main {
    /**//from  ww  w .  j  av a 2 s.  c o m
     * Create a menu.
     *
     * @param label the label text for the menu.
     * @param mnemonic the mnemonic for the menu accelerator.
     * @param accessibleDescription the description of the menu for tool tips, etc.
     * @return a menu.
     */
    public static JMenu createMenu(final String label, final String mnemonic, final String accessibleDescription) {
        JMenu menu = new JMenu(label);
        menu.setMnemonic(mnemonic.charAt(0));
        menu.getAccessibleContext().setAccessibleDescription(accessibleDescription);

        return menu;
    }
}

Related

  1. appendMenuSubElements(MenuElement element, StringBuilder builder, String indent)
  2. applyContextMenuFontRecurse(MenuElement item, Font font)
  3. buildManualsMenu(File appDir)
  4. constructViewMenu(ActionListener act, boolean showUMLOption, boolean showShortenedSourceOption, boolean showJavadocsOption, boolean showSourceOption)
  5. createActionMenu(JTextComponent text, boolean includeModifying)
  6. createMenu(final String name, final int mnemonic)
  7. createMenu(final String text)
  8. createMenu(final String text, final char mnemonic)
  9. createMenu(String label, int mnemonic, String description)