Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Executable jar - including image files

 
Ben Wood
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
have just created executable jar for a small test app which includes a jpeg that is drawn on a JPanel somewhere in the program. Problem is when I double click the jar the image is not appearing.
Is there any special way I need to add resources such as image files to a jar, or a special way to reference them in the app code? I assumed I could just include the jpeg in the jar and it would work, but apparently not.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any special way I need to add resources such as image files to a jar, or a special way to reference them in the app code?
Try this:
 
Ben Wood
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eugene, that worked
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic