0% found this document useful (0 votes)
23 views4 pages

Codigo Del Applet

This Java code defines a class called Datos that extends the JApplet class. The class initializes GUI components like labels, text fields, and a button to collect and display a user's name and email address. When the button is clicked, it retrieves the values from the text fields and displays the information in a label.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views4 pages

Codigo Del Applet

This Java code defines a class called Datos that extends the JApplet class. The class initializes GUI components like labels, text fields, and a button to collect and display a user's name and email address. When the button is clicked, it retrieves the values from the text fields and displays the information in a label.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

/*

* To change this license header, choose License Headers in Project Properties.


* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author laptop
*/
public class Datos extends javax.swing.JApplet {

/**
* Initializes the applet Datos
*/
@Override
public void init() {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the
default look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(Datos.class.getName()).log(java.util.logging.Lev
el.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(Datos.class.getName()).log(java.util.logging.Lev
el.SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(Datos.class.getName()).log(java.util.logging.Lev
el.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(Datos.class.getName()).log(java.util.logging.Lev
el.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the applet */


try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
public void run() {
initComponents();
}
});
} catch (Exception ex) {
ex.printStackTrace();
}
}

/**
* This method is called from within the init() method to initialize the
* form. WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

jLabel1 = new javax.swing.JLabel();


jLabel2 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();

jLabel1.setText("Datos del Aprendiz");

jLabel2.setText("Nombre :");

jLabel4.setText("Correo :");

jTextField3.setText("Ingrese aquie su nombre completo");

jTextField4.setText("Ingrese aqui su correo eletronico");


jTextField4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField4ActionPerformed(evt);
}
});

jButton1.setText("Consulte aqui");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jLabel3.setText("Informacion del aprendiz :");

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(53, 53, 53)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel4))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.LEADING, false)
.addComponent(jTextField4)
.addComponent(jTextField3,
javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)))
.addComponent(jButton1)
.addComponent(jLabel3)))
.addGroup(layout.createSequentialGroup()
.addGap(208, 208, 208)
.addComponent(jLabel1)))
.addContainerGap(166, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(30, 30, 30)
.addComponent(jLabel1)
.addGap(36, 36, 36)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.BASELINE)
.addComponent(jLabel2)
.addComponent(jTextField3,
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELAT
ED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.BASELINE)
.addComponent(jLabel4)
.addComponent(jTextField4,
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(28, 28, 28)
.addComponent(jButton1)
.addGap(26, 26, 26)
.addComponent(jLabel3)
.addContainerGap(206, Short.MAX_VALUE))
);
}// </editor-fold>

private void jTextField4ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

String Nombre;
String Correo;
Nombre = jTextField3.getText();
Correo = jTextField4.getText();
jLabel3.setText("Informacion solicitada es : " + Nombre +" , "+ Correo);
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
// End of variables declaration
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy