This tip shows how to close the browser window when user presses a button.

import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import netscape.javascript.*;

public class WinClose extends Applet implements ActionListener{
    
    Button wc = new Button("Close me");
    
    public void init() {
        wc.setActionCommand("CLOSE");
        wc.addActionListener(this);
        add(wc);
    }
    
    public void actionPerformed(ActionEvent e) {
        String command = e.getActionCommand();
        if (command.equals("CLOSE")) {
            JSObject win = (JSObject) JSObject.getWindow(this);
            win.eval("self.close();");
        }
    }
}