Several points:
1) Your screen name does not conform to Javaranch rules. You
have been asked before to change it - please do so.
2) An applet can't call System.exit due to security restrictions (unless it is signed).
3) What should happen if the applet is closed - should the web page it is embedded in be closed? That is tricky to do in the general case. Or does the applet open its own window? That should be easy to close, but the applet will still be there as part of the web page.
4) What error do you get? Show us the exception, and show us the relevant code section (not the whole applet).