Mac OS xx dock application name setting not working?

I tried to set the name and icon of the application 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 icon object is java.awt.Image. The Alfabet class creates the main program JFrame. The icon is displayed correctly, but the application name is not displayed; it still displays the name of the main class of the program. What am I doing wrong? Thanks.

+3
source share
1 answer

It is not clear where everything is going, but here is a complete working example here .

Alternatively, try setting the name from the command line:

 java -Xdock:name=Alfabet 

See also Introductory Topics .

+2
source

Source: https://habr.com/ru/post/1203516/


All Articles