Java JMenuItem configureMenuItem(JMenuItem item, Action action)

Here you can find the source of configureMenuItem(JMenuItem item, Action action)

Description

configure Menu Item

License

Open Source License

Declaration

private static void configureMenuItem(JMenuItem item, Action action) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.Action;

import javax.swing.JMenuItem;

import javax.swing.KeyStroke;

public class Main {
    private static void configureMenuItem(JMenuItem item, Action action) {
        KeyStroke keystroke = (KeyStroke) action.getValue(Action.ACCELERATOR_KEY);
        if (keystroke != null) {
            item.setAccelerator(keystroke);
        }//from ww w.j av a2  s .  c om

        item.setIcon(null);
        item.setToolTipText(null);
    }
}

Related

  1. addMenuItem(final JMenuItem mi, final C topLevelMenu, final List path)
  2. aplicarMenu(JMenuItem loMenuO, JMenuItem loMenuD)
  3. applyDefaultProperties(final JMenuItem comp)
  4. attachAcceleratorKeyNoCtrl(JMenuItem item, int keyEvent)
  5. cloneMenuItem(final JMenuItem item)
  6. createJMenuItem(Action action)
  7. createJMenuItem(JMenu menu, String text, int mnemonic, int acceleratorKey, String toolTip, ActionListener actionListener)
  8. createMenu(JMenuItem[] items, String name, String description, int mnemonic)
  9. exit(JMenuItem anItem)