Reputation: 2670
I tried to set the application name and icon for the Mac OS X dock in my Java program. I used the following code:
public static void main(String[] args)
{
Application.getApplication().setDockIconImage(icon); // Dock icon
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Alfabet"); // Program name
new UpdateChecker(); // Check for an update
new Alfabet(); // Start the program
}
The object 'icon' is an java.awt.Image. The class Alfabet creates the main JFrame of the program. The icon shows up correctly, but the application name doesn't, it still displays the name of the main class of the program. What am I doing wrong? Thank you.
Upvotes: 4
Views: 4232
Reputation: 205785
It's not clear where things are going awry, but there's a complete working example here for reference.
Alternatively , try setting the name from the command line:
java -Xdock:name=Alfabet
See also Initial Threads.
Upvotes: 3