tags:

views:

185

answers:

2

Hello all! I have a slight problem. Having recently migrated on Mac, I've been pulling my hair and searching the web about this but have not found what I was exactly searching for. I want to set the application name in the system menu, which doesn't work at the moment (my main class name is displayed instead of my app name). What property should I modify?

I have successfully placed my menu in the system menu bar using the correct apple.laf property, but I haven't found what I needed for the name.

My search led me to Info.plist documents, on which I have no knowledge whatsoever. I tried to make a simple one that would only change the app's display name, but for some reason it hasn't worked. Help?

+2  A: 

According to sun's documentation you would pass the name into the virtual machine as a command line parameter to the java command with -Xdock:name="{AppName}" replacing {AppName} with what you want to appear as the title in the Menu bar.

Edit: I do not believe that you can set this in the actual Java code itself, but as Chuck said Apple does have a program Jar Bundler which is designed to create the jar with the Info.plist that you need. According to the user guide for it, you need to set the Bundle Name property on the properties pane to get what you want.

Brandon Bodnár
I'm looking for a method of achieving it from within the code, that wouldn't imply fiddling around with that kind of stuff.
MrZombie
+2  A: 

Try using the included Jar Bundler, which is there to handle all this stuff for you. And if you want to see how any particular feature works, you can inspect Jar Bundler's output.

Chuck