IDEA, Java, gui-application. I imported a few images into the project that are displayed in the application.

They lie on the way ./src/myproject/images/1.gif

When I run (Run) in IDEA, everything works, but when I build a project in .jar through the Project Structure - artifacts, and I run the resulting jar image file in the application there. What could be the problem?

  • collect mavenov? - Victor
  • Try putting pictures in the resources folder marked as resources. - Vlad Leonidov

1 answer 1

All application resources are stored in the resources folder, and make sure that it differs in color from others. Check the path specified in the code. Specify only relative paths.