1HBox container = (HBox) menubar.lookup("HBox");
2 for(int i=0;i<container.getChildren().size();i++) {
3 Node parentNode = container.getChildren().get(i);
4 Menu menu = menubar.getMenus().get(i);
5 parentNode.setOnMouseMoved(e->{
6 menu.show();
7 });
8 }