B4J Question How to change JAVA in Apple menu

ThRuST

Well-Known Member
Licensed User
Longtime User
MainForm.Title = "applicationname" won't change the fact that it says 'JAVA' at the top in Apple menu when I run my program on a Mac. Since Title has nothing to do with the panes titlebar I wonder how to set application name in, yea you're right the topmounted fixed black Apple menu ever since 1984.
 

ThRuST

Well-Known Member
Licensed User
Longtime User
In Java this does it, but how to change it from B4J?

Java
B4X:
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "ImageRotator");
 
Last edited:
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
screenshot.jpg


This is what it looks like when I added the code. It did not change anything it seems.
I have no idea what's being changed. I found the original Java code online.
I am sure this screenshot will help to track how to make neccessary changes.
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
Using Java 8 on Mac OS X 10.9, setting the System property

System.setProperty("com.apple.mrj.application.apple.menu.about.name","Name");
appears to be ineffectual in changing the name displayed in the application menu. Alternatives that still work include these:

  • By default, the application menu will display the simple name of the class specified in the javacommand line or the Main-Class attribute of the JAR's manifest.

    java -cp build/classes mypackage.Name
    java -jar dist/MyJar.jar
  • Use the -Xdock:name="Name" command line parameter.

    java -Xdock:name="Name"-cp build/classes mypackage.Main
    java -Xdock:name="Name"-jar MyJar.jar
  • Add the application JAR to a Mac application bundle, as shown here, an add the attribute to the Info.plist.

    <key>JVMOptions</key>
    <string>-Xdock:name=Name</string>
 
Upvote 0
Top