Here you can find the source of configureMenuItem(JMenuItem item, Action action)
private static void configureMenuItem(JMenuItem item, Action action)
//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); } }