Applet Running Issues

Hello! I am Arachanox, and this is my first post here on javagaming.

I have just finished a year of taking a computer science course in Java at my school and recently took the Computer Science AB test (though the results are not back yet). Wanting to put my new knowledge of the language to good use, I have decided to program a rudimentary game for fun. The issue is, I have no prior experience with applets and graphics. I have looked around and found some great tutorials on graphics, so I believe that I will be able to handle that without too much issue for a little while until I get to more complicated things.

My problem is this. Say I have an applet called “AppletTest.class”. In order to run it, I create a notepad file (named AppletRunner) with the following:

<html>
<body>
<p><applet code ="AppletTest.class" width=300 

height=300>
</applet></p>
</body>
</html>

I then save it as a .html file and then run it from my web browser (Firefox). It usually works on the first try, but if I make ANY changes to AppletTest and try to reopen AppletRunner, the changes do not appear! In fact, it takes any amount of time between five and fifteen minutes for AppletRunner to realize that I made changes to the AppletTest file. What is going on here? If I have to wait long periods of time after every individual tweak I make, then the process will become so unbearably long that I’d quit after another day. Is there another way to run applets, or am I doing something wrong in running them?

Thanks!

Your browser caches the applet, close the browser and reopen it to see the updated version.

Your solution worked perfectly ;D

Shame I must close all my internet tabs before testing each piece of code, but I’m glad that it works. Thanks for your help!

If you have php on your server you can call add
archive=“mygame.jar?modified=”

Then it will always be cached unless you update it, works great for me and I never have to close the browser or clear the cache in-between changes.

wow cool trick,
thanks for sharing.

No problems. If you aren’t fluent in php this is how to check when a file was modified:

<?php $LastMod=date("YmdHis", filemtime("Dreamlandz.jar")); ?>

Then inside the tag you can add archive=“Dreamlandz.jar?lastmod=<?=$LastMod?>”