我正在使用 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/