Ver Mensaje Individual
  #4 (permalink)  
Antiguo 31/01/2006, 14:20
Avatar de dogduck
dogduck
 
Fecha de Ingreso: enero-2006
Ubicación: ¿Atlantida, Hesperides, Islas afortunadas?
Mensajes: 2.231
Antigüedad: 18 años, 4 meses
Puntos: 19
Pues buscando :How do I close the browser window when an applet closes?
http://www.irt.org/script/4070.htm

Y resumiendo te pone que uses en el Appletthis.showDocument(URL) ante un evento ( como el click de un JButton) y en URL tiene que ser un documento que haga que se cierre el navegador con JavaScript

Que seria una solución híbrida . Pero parece que has tenido suerte. Encontré esto en http://www.rgagnon.com/javadetails/java-0282.html

Código:
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();");
   }
  }
}
Pero no he probado si funciona , parece que no haria falta ni firmar el Applet.