-1

my "program" showing image but only when is in the same folder with the.jpg file. I want to have my image in .jar file how can i do this? my code

 image = new ImageIcon("pobrane.jpg").getImage();

Thanks for help!

Zielpak
  • 98
  • 9

1 Answers1

1
 image = new ImageIcon(getClass().getResource("pobrane.jpg")).getImage();
ToasteR
  • 886
  • 7
  • 20