Código Java:
Ver original/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Bladsmickey
*/
public class prueba
extends javax.
swing.
JFrame {
/**
* Creates new form prueba
*/
public prueba() {
initComponents();
}
/**
* This method is called from within the constructor 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(); jLabel3
= new javax.
swing.
JLabel(); jButton1
= new javax.
swing.
JButton();
jLabel1.setText("Campo Nombre");
jLabel2.setText("Campo Apellido");
jLabel3.setText("Campo Cedula");
jButton1.setText("Probar Variables");
public void actionPerformed
(java.
awt.
event.
ActionEvent evt
) { jButton1ActionPerformed(evt);
}
});
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.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel2)
.addComponent(jLabel3)))
.addGroup(layout.createSequentialGroup()
.addGap(155, 155, 155)
.addComponent(jButton1)))
.
addContainerGap(134,
Short.
MAX_VALUE)) );
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel3)
.
addPreferredGap(javax.
swing.
LayoutStyle.
ComponentPlacement.
RELATED,
167,
Short.
MAX_VALUE) .addComponent(jButton1)
.addGap(40, 40, 40))
);
pack();
}// </editor-fold>
private void jButton1ActionPerformed
(java.
awt.
event.
ActionEvent evt
) { variables b=new variables(); // TODO add your handling code here:
jLabel1.setText(b.nom());
jLabel2.setText(b.ape());
jLabel2.setText(b.cedu());
}
/**
* @param args the command line arguments
*/
public static void main
(String args
[]) { /*
* 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 {
if ("Nimbus".equals(info.getName())) {
javax.
swing.
UIManager.
setLookAndFeel(info.
getClassName()); break;
}
}
java.util.logging.Logger.getLogger(prueba.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(prueba.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(prueba.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(prueba.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/*
* Create and display the form
*/
public void run() {
new prueba().setVisible(true);
}
});
}
// 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
; // End of variables declaration
}