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

First option in the context menu is highlighted without hovering the mouse from

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8u60, 9, openjfx11, openjfx13, openjfx14
    • Fix Version/s: tbd
    • Component/s: javafx
    • Subcomponent:
    • Introduced In Version:
      9
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows

      A DESCRIPTION OF THE PROBLEM :
      when we right click for context menu, the first option in the list is being highlighted without hovering the mouse. This happens only for the first time right click after the application is opened. This behavior is observed from javafx-9. Till javafx-8 its working fine.

      REGRESSION : Last worked in version 8u212

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      try with the below code:

          import javafx.application.Application;
          import javafx.scene.Scene;
          import javafx.scene.control.ContextMenu;
          import javafx.scene.control.Label;
          import javafx.scene.control.MenuItem;
          import javafx.scene.layout.TilePane;
          import javafx.stage.Stage;
          
          public class SampleContextMenu extends Application {
              // labels
              Label l;
          
              public static void main(String args[]) {
                  // launch the application
                  launch(args);
              }
          
              // launch the application
              public void start(Stage stage) {
                  // set title for the stage
                  stage.setTitle("creating contextMenu ");
          
                  // create a label
                  Label label1 = new Label("This is a ContextMenu example ");
          
                  // create a menu
                  ContextMenu contextMenu = new ContextMenu();
          
                  // create menuitems
                  MenuItem menuItem1 = new MenuItem("menu item 1");
                  MenuItem menuItem2 = new MenuItem("menu item 2");
                  MenuItem menuItem3 = new MenuItem("menu item 3");
          
                  // add menu items to menu
                  contextMenu.getItems().add(menuItem1);
                  contextMenu.getItems().add(menuItem2);
                  contextMenu.getItems().add(menuItem3);
          
                  // create a tilepane
                  TilePane tilePane = new TilePane(label1);
          
                  // setContextMenu to label
                  label1.setContextMenu(contextMenu);
          
                  // create a scene
                  Scene sc = new Scene(tilePane, 200, 200);
          
                  // set the scene
                  stage.setScene(sc);
          
                  stage.show();
              }
          }


      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              aghaisas Ajit Ghaisas
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: