aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes  ImageIcon's not displayed when created a executable Jar. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark " ImageIcon Watch " ImageIcon New topic
Author

ImageIcon's not displayed when created a executable Jar.

Pradeep Kumar Singh
Greenhorn

Joined: Jan 03, 2011
Posts: 2
I have created a Java Swing application with an Icon Image and executed in Eclipse it's showing Icon Image but when I exported this application as a Runnable JAR then application is working fine but Icon Image is not displayed.
I am struggling ... could you please let me know the problem?

Regards...
Stanislav Lapitsky
Ranch Hand

Joined: Dec 01, 2009
Posts: 53
How do you create the icon? Guess from a file. But if you pack all the classes and resources in a jar file you can't acess image file.
Try to use

and then create image from the stream.
Pradeep Kumar Singh
Greenhorn

Joined: Jan 03, 2011
Posts: 2
Stanislav Lapitsky wrote:How do you create the icon? Guess from a file. But if you pack all the classes and resources in a jar file you can't acess image file.
Try to use

and then create image from the stream.


Yes.. I was doing the way you guessed..
now its done. thanks for your help.
 
Consider Paul's rocket mass heater.
 
subject: ImageIcon's not displayed when created a executable Jar.