Here you can find the source of attachAcceleratorKeyNoCtrl(JMenuItem item, int keyEvent)
public static void attachAcceleratorKeyNoCtrl(JMenuItem item, int keyEvent)
//package com.java2s; //License from project: LGPL import javax.swing.JMenuItem; import javax.swing.KeyStroke; public class Main { public static void attachAcceleratorKeyNoCtrl(JMenuItem item, int keyEvent) { item.setAccelerator(KeyStroke.getKeyStroke(keyEvent, 0)); }//from www . ja v a 2 s.com }