Setting the default application icon image in Java swing on OS X

前端 未结 5 2137
说谎
说谎 2020-12-06 02:10

I\'m trying to set the icon image for a Jar file:

setIconImage(new ImageIcon(getClass().getResource(\"logo.png\")).getImage());

When runnin

5条回答
  •  再見小時候
    2020-12-06 02:34

    You can place your .icns file in the application bundle's Contents/Resources directory and reference it in your Info.plist file. For example, a file named ApplicationName.icns would be referenced by a entry of this form:

    CFBundleIconFile
    ApplicationName.icns
    

    Some related details are mentioned here.

提交回复
热议问题