Hello,
I have a question about how to set an icon for the main application window (Stage) on Mac.
Currently, I'm using the code below to set an icon from a PNG file.
Stage primaryStage = new Stage(StageStyle.DECORATED);
primaryStage.getIcons().add(new Image(MainApplication.class.getResourceAsStream("/images/app_logo_32x32.png")));
This works most of the time.
However, sometimes when I start the application, the icon displayed near the center of the 'title bar' of the window is 'smeared' or 'fuzzy'.
The same code works fine all the time on Windows.
Has anyone one seen this issue and know how to fix it?
Thanks very much.
My environment:
Mac OS X 10.8.2 Mountain Lion
Java SE 7 1.7.0_06