Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4407753

JMenu:Keyboard navigation not working in Windows releases.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.4.0
    • client-libs

      Steps to reproduce in Windows:
      -----------------------------
      1. Run the following program.
      2. Click "Alt+A". It does not work at all.

      In Solaris, it is slightly better. "Alt+A" takes the user to next level. But that is it. Nothing works beyond that.

      Tried and found happening in Windows2000, Windows98 and Solaris2.6.

      Code used:
      ---------
      import javax.swing.*;
      import java.awt.event.*;

      public class testMenu extends JFrame {
        public testMenu() {
          JMenuBar menuBar;
          JMenu menu, subMenu;
          JMenuItem menuItem;
          
          menuBar = new JMenuBar();
          setJMenuBar(menuBar);
          
          menu = new JMenu("First");
          menu.setMnemonic(KeyEvent.VK_F);
          menuBar.add(menu);
          
          menuItem = new JMenuItem("One", KeyEvent.VK_O);
          menu.add(menuItem);
          
          menu.addSeparator();
          subMenu = new JMenu("Subway");
          subMenu.setMnemonic(KeyEvent.VK_S);
          
          menuItem = new JMenuItem("Within subway", KeyEvent.VK_W);
          subMenu.add(menuItem);
          menu.add(subMenu);
        }
        
        public static void main(String args[]) {
          testMenu frame = new testMenu();
          
          frame.setTitle("testMenu");
          frame.pack();
          frame.setVisible(true);
        }
      }

            mdavidsosunw Mark Davidson (Inactive)
            sramansunw Sridhar Raman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: