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]