Quick question, I created a program for my small business. The program displays the image of the product i sell overseas. It works perfectly until I put it into a Jar file. See the problem is it will only display pictures before I create the Jar file. See the program is suppose to allow pictures to be added as you go.
Icon image = new ImageIcon(getClass().getResource(placeholder + ".png"));
that is the line of code I am using to add the pictures... The placeholder represents the name of the picture. If I drag the picture into the folder and compile the program it works perfectly. instead of compiling the program I make it into a Jar file and use it on other programs it does not work at all. What does not work is the picture does not display at all. Only time it works is if I drag the picture into netbeans and compile it like that. Does all pictures have to be embedded inside the Jar file for it to work properly? I thought I could add pictures as I go.
I can show more code, but I assumed this is a straight question so more code is not needed. If you need more code, let me know.
THanks in advance.