When my
java is in the default package (source code in javasrc folder) I put images in
C:/javasrc/images folder. And the following code will work:
Icon icon = new ImageIcon("Images/cat.gif");
When I use a package name for my class (source code in javasrc/mypackage folder) then I put images in C:/javasrc/mypackage/images. Then the program can not find the image file.
Why?