Article View: es.comp.lenguajes.java
Article #29630java.lang.NoClassDefFoundError - InfoUNNE.java (1/1)
From: KaPiToS
Date: Sat, 15 Nov 1997 00:00
Date: Sat, 15 Nov 1997 00:00
152 lines
5065 bytes
5065 bytes
import java.io.*;
import java.net.*;
import java.applet.Applet;
import java.awt.*;
public class InfoUNNE extends Applet {
String mensaje;
Button BotonEnviar;
Button BotonReset;
Label EtiquetaNombre;
Label EtiquetaEMail;
Label EtiquetaGrupo;
TextField TextoNombre;
TextField TextoEMail;
TextField TextoGrupo;
CheckboxGroup grupo;
Checkbox RadioAlta;
Checkbox RadioModificar;
Label EtiquetaEjemplo;
Label EtiquetaEstado;
=20
public InfoUNNE (){
setLayout(null);
setFont(new Font("Arial",Font.PLAIN,14));
//setBackground(Color.blue);
EtiquetaNombre =3D new Label ("Nombre :", Label.LEFT);
EtiquetaNombre.reshape(13, 16, 60, 24);
add(EtiquetaNombre);
TextoNombre =3D new TextField ("");
TextoNombre.reshape(80, 16, 200, 24);
add(TextoNombre);
EtiquetaEMail =3D new Label ("E-Mail :", Label.LEFT);
EtiquetaEMail.reshape(13, 43, 50, 24);
add(EtiquetaEMail);
TextoEMail =3D new TextField ("");
TextoEMail.reshape(80, 43, 200, 24);
add(TextoEMail);
EtiquetaGrupo =3D new Label ("Grupo :", Label.LEFT);
EtiquetaGrupo.reshape(13, 70, 50, 24);
add(EtiquetaGrupo);=09
=09
TextoGrupo =3D new TextField ("");
TextoGrupo.reshape(80, 70, 100, 24);
add(TextoGrupo);
EtiquetaEjemplo =3D new Label ("ej: 2IT2, 3EM1", Label.LEFT);
EtiquetaEjemplo.reshape(185, 77, 90, 16);
EtiquetaEjemplo.setFont(new Font("Arial",Font.PLAIN,12));
add(EtiquetaEjemplo);
grupo =3D new CheckboxGroup ();
RadioAlta =3D new Checkbox ("Alta", grupo, false);
RadioAlta.reshape(14, 95, 100, 24);
add(RadioAlta);=09
RadioModificar =3D new Checkbox ("Modificar", grupo, false);
RadioModificar.reshape(14, 118, 100, 24);
add(RadioModificar);=09
=09
EtiquetaEstado =3D new Label ("Introduzca sus datos", Label.CENTER);
EtiquetaEstado.reshape(15, 145, 290, 16);
EtiquetaEstado.setFont(new Font("Arial",Font.PLAIN,12));
add(EtiquetaEstado);
BotonEnviar =3D new Button ("Enviar");
BotonEnviar.reshape(130, 105, 50, 24);
add(BotonEnviar);
=09
BotonReset =3D new Button ("Reset");
BotonReset.reshape(200, 105, 50, 24);
add(BotonReset);
}//end constructor
=20
public void init() {
TextoEMail.setText("@correo.unnet.es");
RadioAlta.setState(true);
TextoNombre.requestFocus();
}//end init
public String getAppletInfo(){
return "Name: InfoUNNE\r\n" +
"Author: Joan Fisbein\r\n" +
"Version : 1.0\n" +
"Created with Microsoft Visual J++ Version 1.1";
}//end getAppletInfo
=20
public void conexion (){
try {
EtiquetaEstado.setText ("Estableciendo Conexi=F3n");
Socket sock =3D new Socket =
(InetAddress.getByName("smtp1.ibm.net"),25);
DataOutputStream out =3D new DataOutputStream =
(sock.getOutputStream());
DataInputStream in =3D new DataInputStream (sock.getInputStream());
EtiquetaEstado.setText ("Conexi=F3n OK, Enviando Informaci=F3n");
in.readLine();
out.writeBytes ("HELO xoom.com\n");
out.writeBytes ("MAIL FROM: "+TextoEMail.getText()+"\n");
out.writeBytes ("RCPT TO : JoanF@bigfoot.com\nDATA");
out.writeBytes ("\nSUBJECT: InfoUNNE");
out.writeBytes (mensaje);
out.writeBytes ("\n.\nQUIT\n");
sock.close();
EtiquetaEstado.setText ("Mensaje Enviado");
}
catch (IOException e) {
EtiquetaEstado.setText ("Problema de Conexi=F3n");
}
}//end conexion
public boolean handleEvent (Event e){
if (e.target=3D=3DBotonEnviar && (e.arg=3D=3DBotonEnviar.getLabel()||(
e.id=3D=3DEvent.KEY_RELEASE && e.key=3D=3D'\n'))){
if =
(TextoNombre.getText().length()=3D=3D0||TextoEMail.getText().length()=3D=3D=
0
||TextoGrupo.getText().length()=3D=3D0){
EtiquetaEstado.setText ("Datos Incorrectos");
return true;
}
BotonEnviar.disable();
mensaje=3D"Nombre : " + TextoNombre.getText();
mensaje=3Dmensaje + "\ne-mail : " + TextoEMail.getText();
mensaje=3Dmensaje + "\nGrupo : " + TextoGrupo.getText();
if (RadioAlta.getState()=3D=3Dtrue){
mensaje=3Dmensaje + "\nAcci=F3n : Alta";
}else{
mensaje=3Dmensaje + "\nAcci=F3n : Modificar";
}
conexion();
return true;
}else{=20
if (e.target=3D=3DBotonReset){
TextoNombre.setText("");
TextoEMail.setText("@correo.unnet.es");
TextoGrupo.setText("");
RadioAlta.setState(true); =09
}
return false;
}
}//end handleEvent
=20
//if the user try to load another page, it continue the work
public void stop() {return;}
}//end class InfoUNNE
Technical Details
Message-ID:
<3471c969.980981@gateway>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1116f3,af7a9d27a2f7daf9,start X-Google-Attributes: gid1116f3,public From: XXXX@bigfoot.com (KaPiToS) Subject: java.lang.NoClassDefFoundError - InfoUNNE.java (1/1) Date: 1997/11/15 Message-ID: <3471c969.980981@gateway> X-Deja-AN: 289768406 Reply-To: XXXXX@bigfoot.com Content-Disposition: attachment; filename=InfoUNNE.java Newsgroups: es.comp.lenguajes.java