Here you can find the source of createMenu(final String label, final String mnemonic, final String accessibleDescription)
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. |
public static JMenu createMenu(final String label, final String mnemonic, final String accessibleDescription)
//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; } }