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

Menu mnemonics - both ALT keys can open menu

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8u45, 9
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 x64

      A DESCRIPTION OF THE PROBLEM :
      Both LEFT ALT and RIGHT ALT can open menu with mnemonics parsing enabled. Normally it is only LEFT ALT that opens mnemonics.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Open application with menu (with mnemonics parsing enabled)
      2. Hit RIGHT ALT -> menu opens (it shouldn't)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Only LEFT ALT should open menu when mnemonics parsing is enabled.
      ACTUAL -
      Both LEFT ALT and RIGHT ALT can open menu with mnemonics parsing enabled.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      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 MenuMnemonicsExample 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();
          }
      }
      ---------- END SOURCE ----------

        Attachments

          Activity

            People

            • Assignee:
              ptbrunet Pete Brunet (Inactive)
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: