【问题标题】:Can I add more start menu items to my program with JavaFX?我可以使用 JavaFX 向我的程序添加更多开始菜单项吗?
【发布时间】:2018-03-09 06:07:36
【问题描述】:

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

【问题讨论】:

  • 我已经检查过了,似乎需要一些特殊配置。当我发现一些有用的东西时,我会给你一个答案。 免责声明:我是 JavaFX Gradle 插件的创建者

标签: java windows gradle javafx javafx-gradle-plugin


【解决方案1】:

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

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

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 的创建者

【讨论】:

  • 这很容易。谢谢@FibreFox。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-12-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多