Terminating JApplet...
I have a game I'm busy coding and the the main window is a JApplet, when I exit one game and want to start another, upon starting the other game (running the same JApplet over again) I get the error "java.lang.OutOfMemoryError"
at the moment I have a button that calls applet.destroy(); to kill it...
But if I'm getting the error it means that it's not quite dead, right?
[394 byte] By [
Hagena] at [2007-11-27 10:59:36]

# 1
Thanks for all the help guys....
I figured out (by myself, whoop whoop) that you have to override the Applet.destroy() method in in order for it to actually do something...
For people reading this in future, override the destroy() method if you want to kill the applet! Something like this:
public void destroy ()
{
removeKeyListener (this);
removeMouseListener (this);
temp = null;
for (int ly = 1 ; ly <= y ; ly++)
{
for (int lx = 1 ; lx <= x ; lx++)
{
img [lx] [ly] = null;
}
}
}
Anyone have anything to say about this... ? I know this works, but is there anything I can add/remove from it or something?
Cheers H
Hagena at 2007-7-29 12:24:11 >
