1
Good afternoon.
I’m having trouble with my app.
It executes with changing the icon on JFrame
.
When compiling it for: "Runnable Jar file" and compiling with: Launch4j for Inary, the application simply does not open.
I’m changing the icon by this command:
frame.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/z/app.png")));
Somebody give me a hand please!
– kholyphoenix1
There is not enough information in your question for someone to come up with a useful answer. In what context do you change the icon? How does
/z/app.png
is packaged in the application? Can you make a code minimum, complete and verifiable?– Victor Stafusa
/z/app.png is inside the project folder at eclipse. specifically: F: Development- Eclipse Utilities Quickstage bin z inside the z folder is: "app.png" and "Tray.png"
– kholyphoenix1
Can you see if the icon appears somewhere inside the JAR file? What if this place is the expected place? In particular the use of
getClass().getResource(String)
is something very sensitive to fail depending on whether the application is encapsulated in a JAR file. Again, a MCVE would be helpful enough for you to get better and faster answers: http://answall.com/help/mcve– Victor Stafusa
Victor champion! How can I see in ". jar"? Yes, I’m trying to use MVC. More on this part of image I don’t know how I would look inside it.
– kholyphoenix1
Rename it to ". zip" and open it as a ". zip". And don’t confuse MVC with MCVE, these are completely different things!
– Victor Stafusa