Can I add more start menu items to my program with JavaFX?

269 Views Asked by At

I'm using the JavaFX Gradle plugin to build my JavaFX application. Is it possible to add more than one start menu item to the finished installer?

1

There are 1 best solutions below

1
FibreFoX On BEST ANSWER

After answering your other question regarding additional native launchers I checked the sources of the JDK, to see what is needed for this.

Any launcher with the enabled "needMenu"-property will be reflected in some menu-entry inside the start-menu. Just add something like this to your buildfile:

jfx {
    // ... normal configuration ...

    // your secondary entry points, each will inherit the configuration, unless you specify otherwise here
    secondaryLaunchers = [
        [
            appName: 'somethingDifferent2',
            mainClass: 'your.different.entrypoint.MainApp',
            // the following is required for an start-menu entry
            needMenu: true
        ]
    ]
}

Disclaimer: I'm the creator of that JavaFX-Gradle-plugin