Java menu accelerator not working# Java - 爪哇娇娃
c*t
1 楼
How to get java menu accelerator working? The menu shows
up the correct key sequence, but the accelerator is not
working. Here is a sample code that demonstrates the problem.
Any help would be greatly appreciated. Thanks
import java.awt.event.*;
import javax.swing.*;
public class Menu
{
public static void main (String[] args)
{
JFrame frame = new JFrame ();
JMenuBar menuBar = new JMenuBar ();
JMenu menu;
JMenuItem item;
menu = new JMenu ("File");
item = new JMenuItem ("Test");
item.addActionL
up the correct key sequence, but the accelerator is not
working. Here is a sample code that demonstrates the problem.
Any help would be greatly appreciated. Thanks
import java.awt.event.*;
import javax.swing.*;
public class Menu
{
public static void main (String[] args)
{
JFrame frame = new JFrame ();
JMenuBar menuBar = new JMenuBar ();
JMenu menu;
JMenuItem item;
menu = new JMenu ("File");
item = new JMenuItem ("Test");
item.addActionL