Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ImageIcon's not displayed when created a executable Jar.

 
Pradeep Kumar Singh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic