List of usage examples for javax.swing JMenuItem JMenuItem
public JMenuItem(String text, int mnemonic)
JMenuItem
with the specified text and keyboard mnemonic. From source file:com.AandR.beans.plotting.imagePlotPanel.CanvasPanel.java
/** * Access to the method used to create the popup menu items used in the Canvas Popup Menu. * @param label/*from w ww . j av a 2 s . c om*/ * @param icon * @param keyStroke * @return */ public JMenuItem createPopupMenuItem(String label, Icon icon, KeyStroke keyStroke) { JMenuItem menuItem = new JMenuItem(label, icon); menuItem.setAccelerator(keyStroke); menuItem.addActionListener(this); menuItem.setBackground(Color.WHITE); menuItem.setEnabled(true); return menuItem; }