I guess, in a way, having ImageIcon.getImage () return an Image object with a height and width of -1 makes some sense.
Some programs have, literally hundreds of images, most of which are insignificant to the core functionality of the program. If you had to deal with try and catching in those circumstances, it might be a big headache (although I don't think it would take too a big a brain to work around it).
Null Image objects might be not better. You might not want to have to
test every insignificant image whether or not it's a real object before you try to draw it. It could bear down on the application.
By returning an actual Image object with significant markers, if the image couldn't be found, you could still draw, but it would just draw a blank. If the images was crucial to the program you could still check it.
I'm just surprised at how hard it was to learn about this. I've been to dozens of websites that actual neglect to mention this fact.
Of course if I had just checked the API...
[ February 06, 2006: Message edited by: Brandon Tom ]