ADDITIONAL SYSTEM INFORMATION :
Behavior observed on Macos and Windows on all versions of JavaFx
A DESCRIPTION OF THE PROBLEM :
For navigation in the menu to take place (selection of MenuItems and opening of popup menus), the mouse button must be released. Otherwise, if the button is pressed, hovering the mouse has no effect on the menu cells (there is no longer any selection of MenuItems and no opening of popup menus).
This behavior is different from all other GUI systems.
In fact the problem goes deeper. If, for example, we hover over components that change color on hover (pseudo-class css hover:), if the mouse button is pressed, the component no longer changes color, exactly like with menus. Likewise, events captured with "setOnMouse...()" such as "MouseEntered" are no longer propagated to components other than the one at the origin of the drag (mouse button pressed, any one for that matter).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a JavaFx application with a menu.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
That the menu behaves like that of any Mac or Windows graphical application when the mouse button is held down.
Ideally, if this behavior could be applied to all of JavaFx. For example, I want to make an ergonomic context menu composed of shapes (right click, opening of the context menu under the mouse, the right button would remain pressed without hindering navigation in the menu and when released, it is the action event of the cell in selection which would be invoked). As it stands, this context menu only works if the right mouse button is released. Note that this is also the case for native JavaFx context menus.
---------- BEGIN SOURCE ----------
MenuBar menubar = new MenuBar();
Menu menu1 = new Menu("MENU 01");
Menu menu2 = new Menu("MENU 02");
Menu menu3 = new Menu("MENU 03");
MenuItem menuItem1 = new MenuItem("ITEM 01");
MenuItem menuItem2 = new MenuItem("ITEM 02");
MenuItem menuItem3 = new MenuItem("ITEM 03");
MenuItem menuItem4 = new MenuItem("ITEM 04");
menubar.getMenus().add(menu1);
menu1.getItems().add(menu2);
menu1.getItems().add(menu3);
menu2.getItems().addAll(menuItem1, menuItem2);
menu3.getItems().addAll(menuItem3, menuItem4);
---------- END SOURCE ----------
FREQUENCY : always
Behavior observed on Macos and Windows on all versions of JavaFx
A DESCRIPTION OF THE PROBLEM :
For navigation in the menu to take place (selection of MenuItems and opening of popup menus), the mouse button must be released. Otherwise, if the button is pressed, hovering the mouse has no effect on the menu cells (there is no longer any selection of MenuItems and no opening of popup menus).
This behavior is different from all other GUI systems.
In fact the problem goes deeper. If, for example, we hover over components that change color on hover (pseudo-class css hover:), if the mouse button is pressed, the component no longer changes color, exactly like with menus. Likewise, events captured with "setOnMouse...()" such as "MouseEntered" are no longer propagated to components other than the one at the origin of the drag (mouse button pressed, any one for that matter).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a JavaFx application with a menu.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
That the menu behaves like that of any Mac or Windows graphical application when the mouse button is held down.
Ideally, if this behavior could be applied to all of JavaFx. For example, I want to make an ergonomic context menu composed of shapes (right click, opening of the context menu under the mouse, the right button would remain pressed without hindering navigation in the menu and when released, it is the action event of the cell in selection which would be invoked). As it stands, this context menu only works if the right mouse button is released. Note that this is also the case for native JavaFx context menus.
---------- BEGIN SOURCE ----------
MenuBar menubar = new MenuBar();
Menu menu1 = new Menu("MENU 01");
Menu menu2 = new Menu("MENU 02");
Menu menu3 = new Menu("MENU 03");
MenuItem menuItem1 = new MenuItem("ITEM 01");
MenuItem menuItem2 = new MenuItem("ITEM 02");
MenuItem menuItem3 = new MenuItem("ITEM 03");
MenuItem menuItem4 = new MenuItem("ITEM 04");
menubar.getMenus().add(menu1);
menu1.getItems().add(menu2);
menu1.getItems().add(menu3);
menu2.getItems().addAll(menuItem1, menuItem2);
menu3.getItems().addAll(menuItem3, menuItem4);
---------- END SOURCE ----------
FREQUENCY : always
- relates to
-
JDK-8167997 JavaFX Menu and MenuBar not consistent with native menus
-
- Open
-
-
JDK-8092118 Menu behavior: Support press-drag-release
-
- Open
-