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

JMenu should stay selected after escape is pressed

XMLWordPrintable

    • b07
    • generic, x86
    • generic, windows_2000
    • Verified

      Run the following test, press to the Menu and select the item
      press escape button

      Actual: The menu becames unselected

      Expected: The menu is still selected

      JDK 1.6

      import javax.swing.*;

      public class MenuTest {
          public static void main(String[] args) throws Exception {
              final JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

              JMenuBar bar = new JMenuBar();
              JMenu menu = new JMenu("Menu");
              menu.setMnemonic('m');
              JMenuItem item = new JMenuItem("Item");
              menu.add(item);

              frame.setJMenuBar(bar);
              bar.add(menu);
              
              frame.setSize(200, 200);
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
          }
      }

            alexp Alexander Potochkin (Inactive)
            alexp Alexander Potochkin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: