System.exit(0);
Even a trusted applet cannot end the JVM that other applets might be running in. At least not directly.
Use AppletContext.showDocument(URL)
instead.
this.getAppletContext().showDocument(thanksForUsingUrl);
By replacing the page containing the applet with thanksForUsingUrl
the stop()
& destroy()
methods for each applet in the page should be called before (finally) the JVM is ended.