Changing Icon of Application in IntelliJ with Java Swing on MacOS

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.
No description
6 Replies
JavaBot
JavaBot•8mo ago
⌛ This post has been reserved for your question.
Hey @Just Jack! 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.
JavaBot
JavaBot•8mo ago
Please format your code to make it more readable. For java, it should look like this:
​`​`​`​java
public void foo() {

}
​`​`​`​
​`​`​`​java
public void foo() {

}
​`​`​`​
straightface
straightface•8mo ago
Stack Overflow
Setting the default application icon image in Java swing on OS X
I'm trying to set the icon image for a Jar file: setIconImage(new ImageIcon(getClass().getResource("logo.png")).getImage()); When running in Mac OS X 10.7.4 I get the following error: Jun 28 15:...
dan1st
dan1st•8mo ago
Also consider using new ImageIcon(getClass().getClassLoader().getResource("assets/IMGs/MetaTune_Icon.png")) instead of new ImageIcon("src/assets/IMGs/MetaTune_Icon.png")
dan1st
dan1st•8mo ago
Stack Overflow
Reading a resource file from within jar
I would like to read a resource from within my jar like so: File file; file = new File(getClass().getResource("/file.txt").toURI()); BufferedReader reader = new BufferedReader(new FileRea...
Stack Overflow
How do I load a file from resource folder?
My project has the following structure: /src/main/java/ /src/main/resources/ /src/test/java/ /src/test/resources/ I have a file in /src/test/resources/test.csv and I want to load the file from a ...
JavaBot
JavaBot•8mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server