Since your icon isn't loading and mine (when I run your code with your image) *is*, it would seem that there might be something else about how you are running the code that is getting in the way. IDE or whatever - something you haven't said.

(Use forward slashes for the file name if you are specifying the path explicitly. And a better name for the class would be Test, or ImageIconTest.)

12-04-2010, 01:11 AM

enerj

and what is imgF ? an image file?

I am using eclipse and will give the forward slashes, plus what you said a try (I'll try and figure out what imgF should be)

I shouldn't need to specify an absolute path though if the image is in the same folder as the .java file correct?