Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 486
pupeno Avatar asked Sep 27 '17 16:09

pupeno


People also ask

Which root control contains all the menus and menu items?

control. Menu class provides all the methods to deal with menus. This class needs to be instantiated to create a Menu. The following sample of code shows the implementation of JavaFX menu.


1 Answers

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

like image 110
FibreFoX Avatar answered Sep 19 '22 15:09

FibreFoX