Przykład
protected void finalize() throws Throwable {
try {
getApplet().destroy();
}
finally {
super .finalize();
}
}

private Applet getApplet() {
if (_applet == null) {
_applet = new Applet();
}
return _applet;
}

private Applet _applet = null;
Rozwiązanie
Użyj jawnie wywoływanej metody czyszczenia (cleanup) zamiast metody finalize().
protected void free() {
getApplet().destroy();
}

private Applet getApplet() {
if (_applet == null) {
_applet = new Applet();
}
return _applet;
}

private Applet _applet = null;