Change the application name at runtime on Mac for a JavaFX-based App

后端 未结 4 1740
遇见更好的自我
遇见更好的自我 2021-01-06 03:08

Please take a look at this image: http://i.imgur.com/pHIg1AA.png Is it possible to change the application name (\"My JavaFX-based Mac App\") in the Mac OS X system menu bar

4条回答
  •  旧巷少年郎
    2021-01-06 04:02

    Actually, you can change it very easily by using the java-command args
    -Xdock:name=SomeName

    This works fine for me, launching a JavaFX application on a Java11 custom-built runtime with a bash-script as a native application.

    From the Oracles Java 10 documentation:

    -Xdock:name=application name
    Overrides the default application name displayed in dock. [*]

    -Xdock:icon=path to icon file
    Overrides the default icon displayed in dock.

    [*] Also affects the menu name.

    You can see my complete command by looking for 'src_macos/tmpl/George.sh' here: https://bitbucket.org/andante-george/george-application/src

    For the About-dialog simply do do: java.awt.Desktop.getDesktop().setAboutHandler(my_about_handler). In your handler open whatever kind of dialog or window you want.

提交回复
热议问题