写一个页面如下:
<html>
<body onload="window.close()">
</body>
<html>
保存在服务器上名为close_window.html
然后在applet按钮的点击事件中加如下代码:
    try {
      URL url = new URL(getDocumentBase(), "close_window.html");
      this.getAppletContext().showDocument(url);
    }catch(MalformedURLException e) {
    }