Thanks Craig Wood. That piece of program told be that I was doing something wrong and then found how stupid I've been not to check if the class files were created in the same directory where the
java and image files are. I was using JCreator and for some reason it created the class files in a different place. So, when tried to execute (also with JCreator) they didn't find the images.