java - 我可以使用 JavaFX 向我的程序添加更多开始菜单项吗?

标签 java windows gradle javafx javafx-gradle-plugin

我正在使用 JavaFX Gradle plugin构建我的 JavaFX 应用程序。是否可以向完成的安装程序添加多个开始菜单项?

最佳答案

在回答您的 other question regarding additional native launchers 之后我检查了 JDK 的源代码,看看为此需要什么。

任何启用了“needMenu”属性的启动器都将反射(reflect)在开始菜单内的某些菜单项中。只需将类似这样的内容添加到您的构建文件中:

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
        ]
    ]
}

免责声明:我是该 JavaFX-Gradle-plugin 的创建者

关于java - 我可以使用 JavaFX 向我的程序添加更多开始菜单项吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46453186/

相关文章:

java - 正则表达式在 Windows 上不匹配文本,在 Mac 上按预期工作

Android Studio 3.1.4 Gradle 同步失败

java - 某些文件的 maven-assembly-plugin

java - 什么是NullPointerException,我该如何解决?

windows - 如何在 Windows 中更改文件的所有者(命令行)

windows - 作为 Windows 服务的 Cassandra

maven - build war 期间的 Gradle 丢失了图片数据

gradle - 使用gradle复制/同步从zip提取文件时删除文件路径的一部分

java - 现有抽象类 Clock 上的新接口(interface) java.time.InstantSource 的主要目的是什么?

java - 不同尺寸屏幕的布局(Android)