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

[CustomMenuItem] is not focused at the first time of hovering.

    XMLWordPrintable

Details

    Description

      Run attached application and watch attached movie.


      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.*;
      import javafx.scene.layout.HBox;
      import javafx.scene.layout.VBox;
      import javafx.scene.shape.Rectangle;
      import javafx.stage.Stage;

      public class JavaApplication39 extends Application {

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage stage) throws Exception {
              MenuBar mb = new MenuBar();

              Menu menu = new Menu("Menu");
              MenuItem graphics_menu_item = new MenuItem("MENU_ITEM_GRAPHICS_ID", new Rectangle(10, 10));

              CheckMenuItem graphics_check_menu_item = new CheckMenuItem("CHECK_MENU_ITEM_GRAPHICS_ID", new Rectangle(10, 10));

              RadioMenuItem graphics_radio_menu_item = new RadioMenuItem("RADIO_MENU_ITEM_GRAPHICS_ID", new Rectangle(10, 10));

              HBox node_box_bool = new HBox();
              node_box_bool.getChildren().addAll(new Rectangle(10, 10), new Label("NODE_MENU_ITEM_BOOL_ID"));
              CustomMenuItem graphics_node_menu_item = new CustomMenuItem(node_box_bool, true);
              SeparatorMenuItem separator_menu_item = new SeparatorMenuItem();

              menu.getItems().addAll(graphics_menu_item,
                      graphics_check_menu_item,
                      graphics_radio_menu_item,
                      graphics_node_menu_item,
                      separator_menu_item);

              mb.getMenus().add(menu);

              VBox vb = new VBox();
              vb.getChildren().add(mb);

              Scene scene = new Scene(vb, 300, 300);
              stage.setScene(scene);
              stage.show();
          }
      }

      I hover it in the first time, and it is not hovered. It is hovered only starting from the second attempt.

      Attachments

        Activity

          People

            psafrata Pavel Ĺ afrata
            akirov Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: