Applet dont stop!

Hello,

When I open my applet as normal… it starts the java process on the computer… but when I close the tab it keeps working the game… the process is not closed and if I open the page again the player is in the same place… so it keeps working on background

Why does this happen?

Applet code:

[quote] private Game display = new Game();

public void init() {
	setLayout(new BorderLayout());
	add(this.display);
	requestFocus();
}

public void start() {
	this.display.start();
}

public void stop() {
	this.display.stop();
}

public void destroy() {
	this.display.stop();
}

[/quote]
stop code:

[quote] public synchronized void stop() {
SoundEffect.stopAll();
if (!this.running) return;
this.running = false;
try {
this.thread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
[/quote]

Try removing the call to “join()”? That seems unnecessary.

Also, try printing out stuff in the stop() method and see if they are being printed out in the console.

console:

[quote]Close
basic: Finished applet teardown
[/quote]
So yes it printed close so it reached the stop method on the applet clas…

btw the process is kill at about one minute after I closed the tab…

Ah that sounds familiar, applets used to do that. What browser/version and Java version?

I’ve just updated my java so I think 7.17 and using chrome