سؤال

I want to add a shortcut to JMenu (not JMenuItem) but I don't know how... Please, help...

هل كانت مفيدة؟

المحلول

Try this:

    JMenu actionMenu = new JMenu("Actions");
    actionMenu.setMnemonic(KeyEvent.VK_A);

This way you can access it by pressing key ALT + A.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top