tags:

views:

74

answers:

1

I try to load an image with:

ImageIcon imageIcon = new ImageIcon(url);

if I query the load status: imageIcon.getImageLoadStatus(); it returns MediaTracker.ERRORED

Is there a way to get an error message saying what the problem was?

A: 

You can try loading the image via alternate methods. That might give you better feedback:

Image img = ImageIO.read(url);
ImageIcon icon = new ImageIcon(img);
Fred Haslam
I still want to use the background-loading feature the Java ImageIcon API supports. I could use MediaTracker directly but it seems to have the same poblem, ie you can check for failure, but not get a reason why out of it.
Carsten
I am suggesting that you try alternate implementations to see if they fail as well. Then you may get a better idea on why your desired implementation fails.
Fred Haslam