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

Menu mnemonics 'stick' on Windows 7

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 8
    • 7u15
    • javafx

      Mnemonics is "sticking" on with ALT key presses on Windows 7.

      Simple example:

      import javafx.application.Application;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.control.Menu;
      import javafx.scene.control.MenuBar;
      import javafx.scene.control.MenuItem;
      import javafx.stage.Stage;

      public class MenuBug extends Application
      {
      public static void main(String[] args)
      {
      launch(args);
      }

      @Override
      public void start(final Stage primaryStage)
      {
      primaryStage.setTitle("bug");
      Group root = new Group();

      MenuBar mb = new MenuBar();
      Menu file = new Menu("_File");
      MenuItem foo = new MenuItem("foo");

      file.setMnemonicParsing(true);
      file.getItems().add(foo);

      mb.getMenus().add(file);

      root.getChildren().add(mb);
      mb.prefWidthProperty().bind(primaryStage.widthProperty());
      primaryStage.setScene(new Scene(root, 200, 200));
      primaryStage.show();
      }
      }


      On Windows 7, if you press and hold the ALT key, the mnemonic underlines appear, as you would expect. When you release the ALT key - it does not disappear. The next time you press the letter F, (without the ALT key being down) the file menu appears.

      I cannot reproduce this behavior on Linux - it works as expected there.

      I've tested this on Linux (64 bit) - doesn't happen. Windows XP - 32 bit - doesn't happen.
      Windows 7 - 64 bit - happens.

      All with the 1.7.0_17 java release.

            miflemi Mick Fleming
            vortexjfx vortex (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: