1

I have launched my application in Mac OS X. Next to the Apple icon in the top left corner of the screen appears the name of my application. This name appears as the package path of my main class (i.e. pack.age.Uno instead of Uno).

Does anyone know how to fix this annoying thing?

Dylan Wheeler
  • 6,928
  • 14
  • 56
  • 80
  • Maybe this Stack Overflow question will help you: ["Native Swing Menu Bar Support For MacOS X In Java."](http://stackoverflow.com/q/307024/788324) – creemama Jun 03 '12 at 03:18
  • This is a duplicate of [Setting Java Swing application name on Mac](http://stackoverflow.com/questions/3154638/setting-java-swing-application-name-on-mac) – PeterVermont Jan 05 '13 at 18:29

2 Answers2

3

Just add this parameter when launching the program: -Xdock:name=MyApp

Lucas Kuhlemann
  • 169
  • 2
  • 18
1

I've been annoyed by this too. There is no way I know of to override in code reliably. I'll get it working with if (System.getProperty("os.name").contains("Mac")) System.setProperty("com.apple.mrj.application.apple.menu.about.name","My Java App"); but com back later and it wil be back to the "com.me.myapp". On release you can use Jar Bundler to make an app bundle and then the problem goes away.

iracigt
  • 282
  • 1
  • 5
  • 1
    Instead of `System.getProperty("os.name").contains("Mac")`, you should check if it contains `"OS X"` because starting with 10.8, they dropped the "Mac" from the official name, leaving just "OS X". The only reason you would still need to check for "Mac" is if you were still working with Mac OS 9 or earlier for some reason – Thunderforge Sep 01 '13 at 20:47