Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cant load images from my jar  RSS feed

 
Yaroslav Chinskiy
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I have images stored in one of the packages.

i run a sample app that has to load a splash screen.
the app is in com.bla.tst package, the images are in com.bla.images
i can never resolve URL to load them:




Pleas advice.
Thank you
 
clio katz
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Yaroslav,

Looks like you have your packages all jar'red-up (correct me if i'm wrong).

There are several ways to get at the images. I usually create a single 'images' directory in the jar, but if you need multiple dirs ... no problem.

Here are some programming notes i made for myself some time ago:



Regarding the path, if you are loading from the JAR, you can use the relative path eg.


hth!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!