Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error loading image jar

 
Nouf Nassri
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello here is my problem. I just made a little application in this application so I must have an image in system stray so everything works when I run the application with netbeans but I launch it in a jar executable impossible to image

code



there may be mistakes or I can not use well a function of java to insert an image
thanks
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When your image/resources are inside a jar, you need to load them in a different way using getClass().getResource() or getClass().getResourceAsStream().
Search the forums. This topic has been discussed before.
 
Nouf Nassri
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:When your image/resources are inside a jar, you need to load them in a different way using getClass().getResource() or getClass().getResourceAsStream().
Search the forums. This topic has been discussed before.



thank you very much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic