In a JavaFX application on Windows, you can create a menu bar with 4 items named A, B, C, and D, and you will get a menubar with those exact items, "A B C D". On Mac, however, you will get a menu bar with items "java A B C D".
From what I have learned from the many forum posts about this problem, you can customize the name of the "java" menu item, by sending a special property to the java packager called mac.CFBundleName.
I think there are several problems with this design:
1. It may not be known until runtime, what the name of the item is. An application could be called "Terminal" in engish, and "Kommandolinje" in Danish, and in that case, the app would not be able to set the name of the item, until the user logged in to the app, and his locale was known.
2. For developers it is counter intuitive, that when you define a menu bar with 4 items you get 4 items on some platforms and 5 on Mac. This makes JavaFX harder to learn.
3. Not being able to customize the contained items of the left most menu of an app is a serious problem. On the mac, Apple has user interface guidelines that dictate that certain menu items of an application, such as "Preferences", should be located into the left most menu. This is not achievable with JavaFX.
As an example, in a drawing application named Draw, you might add the following menu bar on Mac
Draw File Edit Window Help
If you do this, JavaFX should hide the old "java" menu bar item. Today it does not, and you end up with
java Draw File Edit Window Help
Then if you customize the name of the "java" menu item as "Draw", you end up with
Draw Draw File Edit Window Help
Which, as you can see, really does not help.
I suspect that this design problem stems from the fact, that the JVM used to create a "java" menu item on Mac. However, for JavaFX I think this non-app related menu item should be hidden automatically, as soon as the JavaFX app adds its own menu bar. When the developer takes control of the menu bar, it should also be his sole responsibility that the menu bar is correct.
From what I have learned from the many forum posts about this problem, you can customize the name of the "java" menu item, by sending a special property to the java packager called mac.CFBundleName.
I think there are several problems with this design:
1. It may not be known until runtime, what the name of the item is. An application could be called "Terminal" in engish, and "Kommandolinje" in Danish, and in that case, the app would not be able to set the name of the item, until the user logged in to the app, and his locale was known.
2. For developers it is counter intuitive, that when you define a menu bar with 4 items you get 4 items on some platforms and 5 on Mac. This makes JavaFX harder to learn.
3. Not being able to customize the contained items of the left most menu of an app is a serious problem. On the mac, Apple has user interface guidelines that dictate that certain menu items of an application, such as "Preferences", should be located into the left most menu. This is not achievable with JavaFX.
As an example, in a drawing application named Draw, you might add the following menu bar on Mac
Draw File Edit Window Help
If you do this, JavaFX should hide the old "java" menu bar item. Today it does not, and you end up with
java Draw File Edit Window Help
Then if you customize the name of the "java" menu item as "Draw", you end up with
Draw Draw File Edit Window Help
Which, as you can see, really does not help.
I suspect that this design problem stems from the fact, that the JVM used to create a "java" menu item on Mac. However, for JavaFX I think this non-app related menu item should be hidden automatically, as soon as the JavaFX app adds its own menu bar. When the developer takes control of the menu bar, it should also be his sole responsibility that the menu bar is correct.
- links to
-
Review(master) openjdk/jfx/1737