-1

I made a small java program with a Frame showing a small ImageIcon. I'm using IntelliJ to make my programs. When I click on "Run", it shows me the Frame with the picture. Then I made a JAR file out of it, and now it just shows me the Frame but not the Image. What can I do?

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
Kenta1561
  • 29
  • 1
  • 10

1 Answers1

1

You must add the picture to your resources folder, and insert it in your classpath!

PcS
  • 38
  • 8
  • Do you mean with "You must add the picture to your resources folder" that i have to create a resource folder and add that picture into there? If so, I did that already. And how can I insert it into my classpath? – Kenta1561 Jun 11 '16 at 17:04
  • 1
    Could you add more details to this answer? Thanks – OneCricketeer Jun 11 '16 at 17:13
  • Which detail do you need? – Kenta1561 Jun 11 '16 at 17:16
  • It depends on the IDE you´re using! check IDE doc. Then you´ll probably have to use: getClass().getResource("/someImage.png"); – PcS Jun 12 '16 at 14:54