#Changing Icon of Application in IntelliJ with Java Swing on MacOS

7 messages · Page 1 of 1 (latest)

fallow flame
#

Why does the icon of my app not change with IntelliJ on Mac? I find Swing to barely change anything on Mac, like the title bar. Here is the code I'm using:

    frame = new JFrame("File Uploader");
    ImageIcon appIcon = new ImageIcon("src/assets/IMGs/MetaTune_Icon.png");
    if (appIcon.getImageLoadStatus() == MediaTracker.COMPLETE) {
        System.err.println("Loaded image: ");
    }
    frame.setIconImage(appIcon.getImage());

I get no errors and I also get "loaded image" but no changes.

gloomy muskBOT
#

This post has been reserved for your question.

Hey @fallow flame! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

gloomy muskBOT
undone estuary
teal abyss
#

Also consider using new ImageIcon(getClass().getClassLoader().getResource("assets/IMGs/MetaTune_Icon.png")) instead of new ImageIcon("src/assets/IMGs/MetaTune_Icon.png")

#