Java Swing KeyStroke createItem(String name, Integer mnem, KeyStroke accel)

Here you can find the source of createItem(String name, Integer mnem, KeyStroke accel)

Description

Creates and configures a menu item.

License

Open Source License

Declaration

protected static JMenuItem createItem(String name, Integer mnem, KeyStroke accel) 

Method Source Code

//package com.java2s;

import javax.swing.JMenuItem;

import javax.swing.KeyStroke;

public class Main {
    /**//from   ww  w.  j a  v a2s . co  m
     * Creates and configures a menu item.
     */
    protected static JMenuItem createItem(String name, Integer mnem, KeyStroke accel) {
        JMenuItem item = new JMenuItem(name);
        if (mnem != null) {
            item.setMnemonic(mnem.intValue());
        }
        if (accel != null) {
            item.setAccelerator(accel);
        }
        return item;
    }
}

Related

  1. clearKeyStroke(JComponent component)
  2. closeOnKeyStroke(JRootPane rootPane, KeyStroke keyStroke)
  3. componentListensForKey(JComponent component, int keyCode)
  4. configAction(Action action, String text, Icon icon, KeyStroke keyStroke)
  5. convertShortcutMask(KeyStroke ks, int shortcutMask)
  6. createKeyMask(final int aKeyStroke, final int... aMasks)
  7. fixTabKeys(final JComponent component)
  8. getAccelerator(final int key)
  9. getActionForKeystroke(JComponent component, int inputMapId, KeyStroke keyStroke)