Javafx change osx menubar name

假如想象 提交于 2020-12-05 00:56:29

问题


I am using Netbeans trying to change the title when the program runs from java to Phantom. I also would like to change where it says phantom.Main to Phantom. I am not sure if I do this in: Java, Netbeans, Netbeans priorities or the ant build.xml file (or even somewhere else). I can not find any documentation on this either. Any help on this would be great!

Change Title


回答1:


The "java" name in the (Mac OS X) application menu is only used when you run the application from within Netbeans. If you were to package the application into a DMG, and then run the resulting app, the name of the application will appear in that location.




回答2:


I was wondering the same, after some googling I found this post which has a solution to changing the menu bar at the top, but not the menu that says "java": How to make an OS X menubar in JavaFX

EDIT: It essentially says that that if you want to have a so called system menu bar, you have to invoke the function setUseSystemMenuBar(true) on the MenuBar item. One more thing to mention is that it doesn't work if there are no MenuItems in the menu.




回答3:


You may not be able to do it via Netbeans or any other IDE, but you can definitely do it while creating an application bundle, using JavaFX Ant Script.

To get it display a custom name, change application name in the packaging procedure.

To know how to package your application, please visit - https://stackoverflow.com/a/30162808/1759128

For more information, refer

http://docs.oracle.com/javafx/2/deployment/javafx_ant_tasks.htm

Example

http://docs.oracle.com/javafx/2/deployment/javafx_ant_tasks.htm#CIAHEGJD



来源:https://stackoverflow.com/questions/23768839/javafx-change-osx-menubar-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!