Hello!

My applet draws different images from my web-site.

But I don't know in advance if an image exists on the site or not.

My applet should draw image if it exists on the site and create a blank image if it doesn't exist on the site.

I use method getImage and I reimplement interface ImageObserver:

public boolean imageUpdate (Image image, int infoflags, int x, int y, int width, int height)
{
if ( ((infoflags & ImageObserver.ERROR) != 0)
{
// draw blank image
return false;
}

return true;
}

But some how it doesn't always work. Sometimes I get the following uncaight exception in Java console:


Uncaught error fetching image:
java.lang.SecurityException: illegal URL redirect
at followRedirects(Unknown Source)
at BasicHttpRequest.doRequest(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX (Unknown at DownloadEngine.isUpdateAvailable(Unknown Source)
at DeployCacheHandler.get(Unknown Source)
at HttpURLConnection.plainConnect
at HttpURLConnection.connect(Unknown[/url] Source)
at HttpURLConnection.getInputStream(Unknown[/url] Source)
at URLImageSource.getDecoder(Unknown Source)
at InputStreamImageSource.doFetch(Unknown Source)
at ImageFetcher.fetchloop(Unknown Source)
at ImageFetcher.run(Unknown Source)

and the execution stops.

Any ideas what could be the reason of it?