We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Strange Applet Reload Problem
Page Index Toggle Pages: 1
Strange Applet Reload Problem (Read 378 times)
Strange Applet Reload Problem
Sep 29th, 2008, 1:50am
 
Hi,

I assume this is a problem with my Java code and nothing to do with Processing, but it's worth a shot asking the community here if they have seen this behaviour.

I have a large, non-OpenGL applet game running perfectly with sound and everything else. The game runs once perfectly, but when the game is over (and exit() is called) the game data still appears to be in memory. For instance, reloading the HTML page (and restarting the game) will mean that the new game image is overlayed on the previous game's image. The effect is quite strange. I have tried a number of changes to how items are cleaned up at the end of the game, but to no avail.

I have never developed applets before, strictly an application developer, so it may be obvious to others what this is. I suspect there is applet method I should call that stops and destroys the game, but the docs on stop() and destroy() do not enlighten me.

Any ideas?

Regards,

Stephen
Re: Strange Applet Reload Problem
Reply #1 - Sep 29th, 2008, 10:22pm
 
I am not a specialist on applets, but I know enough of Web applications to ask some questions: what is your system? your browser? (did you tried that on several browsers?) what JRE is used by your applet? (not sure if it is useful, but too much info doesn't hurt...)

If your applet is available on a live page, can you give an URL, so we can see if we can reproduce the issue?

The only problem I had with my experiments with applets is the browser reloading the old jar instead of the new one I just made... I found out I have to go to the Java control center (on the tray notification area in Windows) to reset the applet cache before reloading the page.
Re: Strange Applet Reload Problem
Reply #2 - Sep 29th, 2008, 11:12pm
 
PhiLho  wrote on Sep 29th, 2008, 10:22pm:
I am not a specialist on applets, but I know enough of Web applications to ask some questions: what is your system your browser (did you tried that on several browsers) what JRE is used by your applet (not sure if it is useful, but too much info doesn't hurt...)

If your applet is available on a live page, can you give an URL, so we can see if we can reproduce the issue

The only problem I had with my experiments with applets is the browser reloading the old jar instead of the new one I just made... I found out I have to go to the Java control center (on the tray notification area in Windows) to reset the applet cache before reloading the page.


Hi, thanks for the reply. I left out those details because I thought that too much info would cloud the issue Smiley

The problem happens on all browsers and XP/OSX, on different JDK/JREs and although it is in live beta, I can't give a link to it (yet). The browser is loading the jar fine, but the game state (and the graphics rendering oddly) seem to remain from one game to the other. I'm going to try some more things. I developed it in Eclipse which didn't show any of these issues in testing.
Page Index Toggle Pages: 1