Please take a look at this image: http://i.imgur.com/pHIg1AA.png Is it possible to change the application name ("My JavaFX-based Mac App") in the Mac OS X system menu bar at runtime after the app starts? If it's not possible to change at runtime, is there a way to change it after app restarts? I think that name came from Info.plist. The app is built using JavaFX ant task for Mac OS X.
Thanks.
When using javafx-maven-plugin you can specify it in your pom.xml like this:
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.6.0</version>
<configuration>
<appName>Aaa Working Title</appName>
...
</configuration>
...
</plugin>
I'm aware of two methods of achieving what you want:
1) Call javafx.awt.Desktop.getDesktop
from the main thread before creating any stages:
object MYAPP
{
def main(args: Array[String]) =
{
val d = java.awt.Desktop.getDesktop
// ...optionally, add handlers for interesting desktop events
javafx.application.Application.launch(classOf[MyApp], args: _*)
}
}
I believe, among other things, this renames the application menu to MYAPP.
2) Package your application using the javapackager
tool.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With