gracias anticipadas
Si hago un extend de applet y tengo el import del applet. ese error daba porque tenia el siguiente cast y _appPadre.getParent() devuelve un Container:
dl = new Dialog((Frame) _appPadre.getParent(),"Validación del usuario",false);
lo he corregido despues de darle vueltas a la cabeza de la siguiente manera:
dl = new Dialog(new Frame(),"Validación del usuario",false);
pero ahora el error es el siguiente y ahora no tengo ningun cast:
java.lang.ClassCastException: sun.plugin.AppletViewer cannot be cast to java.awt.Frame
at onda.gui.AppValidacion.init(AppValidacion.java:82)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
La linea 82 es el comienzo del metodo init, os lo copio por si vosotros vierais algo:
public void init()
{
//DM solo desarrollo
// txtUsuario.setText("PGAMEZRE");
// txtPassword.setText("PGAMEZRE99");
txtUsuario.setText("");
txtPassword.setText("");
//fin DM
try
{
_appPadre = ((_appPadre == null) ? this : _appPadre);
_sap = new SAPConnect();
String parent = _appPadre.getParent().toString();
System.out.println(parent);
dl = new Dialog(new Frame(),"Validación del usuario",false);
td = new TextoDescriptivo();
jbInit();
_dbAccess = new DBAccess();
//Cambiado el 31-03-2000 para poder llamar a la validación
//desde otro sitio que no sea la aplicación
/*
_ok = new MsgBox( "", MsgBox.OK_IMAGE, this, false );
_stop = new MsgBox( "", MsgBox.STOP_IMAGE, this, false );
*/
_ok = new MsgBox( "", MsgBox.OK_IMAGE, _appPadre, false );
_stop = new MsgBox( "", MsgBox.STOP_IMAGE, _appPadre, false );
_msg = new Mensaje( _dbAccess );
}
catch (Exception e)
{
e.printStackTrace();
}
txtPassword.setEchoChar( '¤' );
dl.setResizable( false );
dl.setVisible( true );//comentada DM solo desarrollo 20020219
/*System.out.println("REQUEST_HEADER1:" + Entorno.REQUEST_HEADER1);
System.out.println("classes_DB_HEADER:" + Entorno.CHANGES_CLASSES_HEADER);
System.out.println("DB_HEADER:" + Entorno.CHANGES_DB_HEADER);
System.out.println("TEST_HEADER:" + Entorno.TEST_HEADER);
*/
//try{valida();}catch(Exception excep ){}//DM solo desarrollo 20020219
}
un saludo