Unblocking The Main Thread Solving ANRs and Frozen Frames
To change this template
1. /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* ejercicio5.java
* Createdon 14/09/2011, 04:12:35 PM
*/
package clase2metodologia;
/**
*
* @author Alumno
*/
publicclass ejercicio5 extendsjavax.swing.JFrame {
/** Creates new form ejercicio5 */
public ejercicio5() {
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() {
jbtnnuevo = new javax.swing.JButton();
jbtncalcular = new javax.swing.JButton();
jbtnsalir = new javax.swing.JButton();
jtxthora = new javax.swing.JTextField();
jtxtsegundo = new javax.swing.JTextField();
jtxtminuto2 = new javax.swing.JTextField();
jtxtsegundo2 = new javax.swing.JTextField();
jtxtminuto = new javax.swing.JTextField();
jtxthora2 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jtxtdia = new javax.swing.JTextField();
jtxtminutos = new javax.swing.JTextField();
jtxthoras = new javax.swing.JTextField();
jtxtsegundos = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jbtnnuevo.setText("NUEVO");
jbtnnuevo.addActionListener(new java.awt.event.ActionListener() {
2. public void actionPerformed(java.awt.event.ActionEventevt) {
jbtnnuevoActionPerformed(evt);
}
});
jbtncalcular.setText("CALCULAR");
jbtncalcular.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEventevt) {
jbtncalcularActionPerformed(evt);
}
});
jbtnsalir.setText("SALIR");
jbtnsalir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEventevt) {
jbtnsalirActionPerformed(evt);
}
});
jtxthora.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEventevt) {
jtxthoraActionPerformed(evt);
}
});
jtxtsegundo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEventevt) {
jtxtsegundoActionPerformed(evt);
}
});
jtxtsegundo2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEventevt) {
jtxtsegundo2ActionPerformed(evt);
}
});
jLabel1.setText("TIEMPO 1");
jLabel2.setText("TIEMPO 2");
jLabel3.setText("SUMA DE TIEMPOS");
jLabel4.setText("DIA");
jLabel5.setText("HORA");
jLabel6.setText("MINUTOS");
jLabel7.setText("SEGUNDOS");
jtxthoras.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEventevt) {
jtxthorasActionPerformed(evt);
}
});
jtxtsegundos.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEventevt) {
jtxtsegundosActionPerformed(evt);
}
});
jLabel8.setText("MINUTOS");
jLabel9.setText("SEGUNDOS");
jLabel10.setText("HORA");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());