Your code using an ImageIcon is loading folder16.png, the code using getResource is attempting to load folder.png. Is this a typo in the code or in the post?

Where is the folder containing the image relative to your source code?

Andrzej Borucki
Ranch Hand

Joined: Aug 24, 2013
Posts: 50

posted Sep 10, 2013 12:34:55

1

Right now is OK. I use
Problem was that image must be in .class folder, not in .java folder. But happily when compile with Eclipse it is copy from src\ to bin\
I placed in d:\code\junace.git\demo\src\net\sf\junace\demo\folder16.png and getResource call without paths.
Prerequisites to be succeeded
- after placing to src\package directory refresh (F5) project
- if still error, call Project->Clean
- Build and Run

Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2585

55

posted Sep 11, 2013 01:52:29

0

Glad to hear it is resolved and thank you for updating the thread with how you solved it.