-1

I have been asked this question before Can not get image from a path, and i try to do the way as this link NullPointerException when using path name to load image file, but it is still not working for me.

I tried delete file and add a new one or create a folder and put this image file in this folder (image/12345.jpg). All those ways are not working.

Could i need to delete all image file and import it all again?? or is there any way i can do it?? Thank you

Because i tried to export exec jar file. it didn't show the image.

Community
  • 1
  • 1
Jarek Huang
  • 119
  • 3
  • 17
  • 1
    possible duplicate of [Can not get image from a path](http://stackoverflow.com/questions/22971052/can-not-get-image-from-a-path) – 2rs2ts Apr 09 '14 at 19:38
  • 3
    Edit your original question instead of asking a new one. – 2rs2ts Apr 09 '14 at 19:39

1 Answers1

1

try class.getResource("blablabla.png").toURI() and make sure the file is in your classpath. Open the Jar with zip and check.

iil
  • 154
  • 1
  • 3