So I've looked around a fair bit, but I've not been able to find any information on how to make an application menu in JavaFX.
I've seen a project 'Jayatana' which seems to allow applications to have proper application menus in Ubuntu using Intellij at least (as an example).
I've also seen a few suggestions that using something like the following will work for OS X users:-
final List<MenuBase> menus = new ArrayList<>();
menus.add(GlobalMenuAdapter.adapt(menu));
Toolkit.getToolkit().getSystemMenu().setMenus(menus);
And there is also the NSMenuFX project, again for OS X.
And I've also seen the java-gnome project which I think only works for Swing.
But what I'd really like is some way of making application menus, preferably in a non-OS specific manner.
I'm happy to use a third party jar or whatever which does the heavy lifting but really, does anything like this exist?
At this point would my best bet be using Swing to create the shell of the JavaFX application and use methods which will integrate application menus with Swing instead? If that's the case, is there something that can do this automatically from JavaFX and handle the switching of the differing implementations?
edit
In the end, I simply used a combination of both Swing and JavaFX. I put the JavaFX app inside which allowed me to use the application menus which already work in Swing.
Not ideal, but it did work.
setPreferencesHandler
andsetAboutHandler
.