I would like to have "Tools" in the menubar to align right but I've searched a lot on the internet and could not find anything useful so I'm trying it here. The next thing I wanted to fix and did not find is Gridpane which is not filling its parent's size. If any of you know the properties or code to make this happen. Let me know!
public MyMenuBar(StackPane root) {
menu1 = new Menu("KunstwerkLijst");
menuItem1 = new MenuItem("Lijst van kunstwerken");
menuItem1.setOnAction(event ->{
root.getChildren().clear();
new Home(root);
});
menu2 = new Menu("Tools");
menuItem2 = new MenuItem("Admin Panel");
menuItem2.setOnAction(event ->{
root.getChildren().clear();
// new APanel(root);
});
menu1.getItems().addAll(menuItem1, menuItem4, menuItem6, menuItem5);
menu2.getItems().addAll(menuItem2, menuItem3);
this.getMenus().add(menu1);
this.getMenus().add(menu2);