It would be nice to be able to do the same thing with Applets, to let you load a new version of the Applet when you are debugging, but I have found only exiting and restarting the browser works. This is because the underlying JVM (Java Virtual Machine) is not designed to let you unload or replace class files. You can get the effect programmatically by using a new ClassLoader. Then you may have both versions of the class in RAM (Random Access Memory).
In Java programming, the URLConnection.setUseCaches( false)) can force reloading. I have not yet found a simple way to force Toolkit.getDefaultToolkit().getImage( url ) to get a fresh copy. I found that Image.flush does not work. It seems to flush only the Image cache, not other intermediate sources.
Here is a clever dodge dreamed up by Jonathan Bartlett to bypassing various caches to force a reload of an image. If you are reloading images from the web, you can randomize the URL (Uniform Resource Locator) to force reloads. So, if your url is http://www.example.com/image.gif, you could do something like http://www.example.com/image.gif?forcereload=23424, where 23424 is a randomly generated number, or generated by the current time, or something like that. Since it’s a different URL, any cache between you and the server has to reload, except at the server itself which will just ignore the extra dummy parameter.
available on the web at:
optional Replicator mirror
Please email your feedback for publication, letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : . If you want your message, your name or email kept confidential, not considered for public posting, please explicitly specify that. Unless you state otherwise, I will treat your message as a letter to the editor that I may or may not publish in the feedback section. After that, it will be too late to retract it. If you disagree with something I said, especially when sending an ad-hominem attack, a rant composed mainly of obscenities or a death threat, please quote the offending passage and cite the web page where you found it, tell me why you think it is wrong, and, if possible, provide some supporting evidence. I can’t very well fix erroneous or ambiguous text if I can’t find it.
Your face IP:[184.108.40.206]
|Feedback||You are visitor number 16,711.|