views:

40

answers:

1

Hello ,

My Swing Java application works fine on Mac OS X, but its title in Mac's title bar appears like this "org.classes.MainClass" which is the main class's path of my application.

Can i change this title through code or in the Manifest file of my java application ?

+1  A: 

See http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac/ for instructions.

It appears that this is to be done with -Xdock:name="Foo Bar"

Thorbjørn Ravn Andersen
Thanks a lot Thorbjørn ... I've already seen this solution before, and it works fine when i initialize my application from the terminal. But i am using a clickable jar file, so is there an alternative using code or in the manifest file ?
Brad
@Brad, always provide relevant information when asking a question here. This article - http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ - mentions Jar Bundler.
Thorbjørn Ravn Andersen
@Thorbjørn ... Thanks, that was helpful. But it will force me to create a special edition of my program for Mac OS X.
Brad
Apparently so. Naked jar files are not generally polished enough to be pleasing on all platforms. No icons shown on Windows. No titlebars on OS X. Perhaps Java WebStart will do for you?
Thorbjørn Ravn Andersen
@Thorbjørn ... Yes. you are right. Sometimes i wonder: "Is Java really portable ?" ... Everything has a price :) ... I will think about Java WebStart, i didn't try it before.
Brad
Java is portable. You will, however, usually need to add stuff around it to interface it to the surrounding platform. This goes for JEE applications, applets and most other platform interfaces aI know of.
Thorbjørn Ravn Andersen