How to install a high-quality OSX dock icon for a Java SWT application

I wrote a Java SWT application and would like to configure it to use a high quality icon in an OSX dock. This is my current code:

// Prepare window
final Shell window = new Shell();

// Load icons
Display display = window.getDisplay();
ClassLoader loader = InTraceStandaloneUI.class.getClassLoader();
InputStream is16 = loader.getResourceAsStream(
                 "org/intrace/icons/intrace16.gif");
Image icon16 = new Image(display, is16);
is16.close();
InputStream is32 = loader.getResourceAsStream(
                 "org/intrace/icons/intrace32.gif");
Image icon32 = new Image(display, is32);
is32.close();
window.setImages(new Image[] {icon16, icon32});

https://github.com/mchr3k/org.intrace/blob/master/org.intrace/src/org/intrace/client/gui/InTraceStandaloneUI.java

This works for loading 16x16 and 32x32 logos that look OK on Windows, but the logo used by OSX still looks uneven. Do I just need to specify a third version with a higher resolution or use a different image format or API?

+3
source share
3 answers

, Shell.setImages(...) 128x128, OSX, - Apple.

+5

Do not reference the dock icon in Info.plist with

<key>CFBundleIconFile</key>
<string>icon.icns</string>

lines?

+1
source

All Articles