If you don't do anything to your Java application on a Mac OS X system, your Java class name will appear in the Mac menubar. Of course, this isn't a good thing. There are a couple of things you can do to get the name of your Java application on the Mac menu bar, and I'll share all of the ways I know how to do this. I've listed these techniques in order here from "easiest" to "best".
Java Mac application FAQ: Can you share a Java/Mac Ant build script that uses the Jarbundler task to make my Java application look like a native Mac OS X application?
NOTE: This solution is for Mac OS X systems running versions of Java prior to Java 7. If I remember right, it only works on those systems, and therefore only on Mac OS X systems 10.6 and earlier. I'm working on new tutorials for Java 7 and Mac OS X 10.7, 10.8, 10.9, and newer.
Lately I've been doing a lot of Java programming on Apple's Mac OS X platform, and my most recent effort has been to handle drag and drop events in my Java Swing application. Not satisfied to handle "simple" drag and drop events, I decided I wanted to take my application even farther, and let users drag files and images to my Java application icon in the Mac Dock.
Over the last three days I've created a new Java Swing application for the Mac OS X platform, and today I'm giving away all the source code for this project (free of charge). The complete project includes both (a) all the Java source code and (b) all of the Ant build script code needed to build this application. The end result of the build is what appears to the end user to be a native Mac OS X application.
In Part 1 of this tutorial I shared the Java source code you need to handle drag and drop events on Mac OS X. But as I mentioned in that tutorial, the recipe to handle files that are dropped onto your Dock application icon requires a little more work, in particular an Ant build process that uses the JarBundler task. So here in Part 2 of this tutorial, I'm sharing my Ant build script that completes this recipe.
I was going to write a little tutorial on how to use the Jar Bundler Ant task for Mac OS X, but I don't have the time to do that right now.
So, I'll just share my Mac OS X Java Ant build script, which includes the JarBundler task. You should be able to use this Ant build script to build a Java application so it appears to the user to be a native Mac OS X application, even though it's really a Java application under the covers.