SlideShare a Scribd company logo
/*
 * 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() {
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());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
       .addGroup(layout.createSequentialGroup()
         .addGap(160, 160, 160)
         .addComponent(jLabel10)
         .addGap(31, 31, 31)
         .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 60,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(10, 10, 10)
         .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 70,
javax.swing.GroupLayout.PREFERRED_SIZE))
       .addGroup(layout.createSequentialGroup()
         .addGap(60, 60, 60)
         .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 60,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(30, 30, 30)
         .addComponent(jtxthora, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(20, 20, 20)
         .addComponent(jtxtminuto, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(20, 20, 20)
         .addComponent(jtxtsegundo, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE))
       .addGroup(layout.createSequentialGroup()
         .addGap(60, 60, 60)
         .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(40, 40, 40)
         .addComponent(jtxthora2, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(20, 20, 20)
         .addComponent(jtxtminuto2, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(20, 20, 20)
         .addComponent(jtxtsegundo2, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE))
       .addGroup(layout.createSequentialGroup()
         .addGap(50, 50, 50)
         .addComponent(jbtnnuevo)
         .addGap(33, 33, 33)
         .addComponent(jbtncalcular, javax.swing.GroupLayout.PREFERRED_SIZE, 90,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(20, 20, 20)
         .addComponent(jbtnsalir))
       .addGroup(layout.createSequentialGroup()
         .addGap(50, 50, 50)
         .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 110,
javax.swing.GroupLayout.PREFERRED_SIZE))
       .addGroup(layout.createSequentialGroup()
         .addGap(60, 60, 60)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(40, 40, 40)
         .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(30, 30, 30)
         .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 70,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(4, 4, 4)
         .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 60,
javax.swing.GroupLayout.PREFERRED_SIZE))
       .addGroup(layout.createSequentialGroup()
         .addGap(50, 50, 50)
         .addComponent(jtxtdia, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(40, 40, 40)
         .addComponent(jtxthoras, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(40, 40, 40)
         .addComponent(jtxtminutos, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE)
         .addGap(30, 30, 30)
         .addComponent(jtxtsegundos, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE))
    );
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
       .addGroup(layout.createSequentialGroup()
         .addGap(10, 10, 10)
         .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
           .addComponent(jLabel10)
           .addComponent(jLabel8)
           .addComponent(jLabel9))
         .addGap(16, 16, 16)
         .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
           .addComponent(jLabel1)
           .addComponent(jtxthora, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
           .addComponent(jtxtminuto, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
           .addComponent(jtxtsegundo, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
         .addGap(10, 10, 10)
         .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
           .addComponent(jLabel2)
           .addComponent(jtxthora2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
           .addComponent(jtxtminuto2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
           .addComponent(jtxtsegundo2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
         .addGap(20, 20, 20)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jbtnnuevo)
             .addComponent(jbtncalcular)
             .addComponent(jbtnsalir))
.addGap(17, 17, 17)
           .addComponent(jLabel3)
           .addGap(16, 16, 16)
           .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addComponent(jLabel4)
             .addComponent(jLabel5)
             .addComponent(jLabel6)
             .addComponent(jLabel7))
           .addGap(16, 16, 16)
           .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addComponent(jtxtdia, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
             .addComponent(jtxthoras, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
             .addComponent(jtxtminutos, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
             .addComponent(jtxtsegundos, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
      );
pack();
   }// </editor-fold>
private void jtxthoraActionPerformed(java.awt.event.ActionEventevt) {
      // TODO add your handling code here:
   }
private void jtxtsegundoActionPerformed(java.awt.event.ActionEventevt) {
      // TODO add your handling code here:
   }
private void jtxtsegundo2ActionPerformed(java.awt.event.ActionEventevt) {
      // TODO add your handling code here:
   }
private void jbtnnuevoActionPerformed(java.awt.event.ActionEventevt) {
jtxtminuto.setText(null);
jtxtsegundo.setText("");
jtxthora2.setText(null);
jtxtminuto2.setText(null);
jtxtsegundo2.setText(null);
jtxtdia.setText(null);
jtxthoras.setText(null);
jtxtminutos.setText(null);
jtxtsegundos.setText(null);
jbtnnuevo.requestFocus();
     // TODO add your handling code here:
   }
private void jtxthorasActionPerformed(java.awt.event.ActionEventevt) {
      // TODO add your handling code here:
   }
private void jtxtsegundosActionPerformed(java.awt.event.ActionEventevt) {
      // TODO add your handling code here:
}
private void jbtncalcularActionPerformed(java.awt.event.ActionEventevt) {
int h1, m1, s1, h2, m2, s2, dt,th, tm, ts, ma, ha, da;
       h1=Integer.parseInt(jtxthora.getText());
     m1=Integer.parseInt(jtxtminuto.getText());
     s1=Integer.parseInt(jtxtsegundo.getText());
     h2=Integer.parseInt(jtxthora2.getText());
     m2=Integer.parseInt(jtxtminuto2.getText());
     s2=Integer.parseInt(jtxtsegundo2.getText());
ts=(s1+s2)%60;
ma=(s1+s2)/60;
tm=(m1+m2+ma)%60;
ha=(m1+m2+ma)/60;
th=(h1+h2+ha)%24;
da=(h1+h2+ha)/24;
dt=da;
jtxtdia.setText(String.valueOf(dt));
jtxthoras.setText(String.valueOf(th));
jtxtminutos.setText(String.valueOf(tm));
jtxtsegundos.setText(String.valueOf(ts));
jbtnnuevo.requestFocus();
        }
private void jbtnsalirActionPerformed(java.awt.event.ActionEventevt) {
System.exit(0);      // TODO add your handling code here:
   }

  /**
  * @paramargs the command line arguments
  */
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ejercicio5().setVisible(true);
         }
     });
  }
  // Variables declaration - do not modify
privatejavax.swing.JLabel jLabel1;
privatejavax.swing.JLabel jLabel10;
privatejavax.swing.JLabel jLabel2;
privatejavax.swing.JLabel jLabel3;
privatejavax.swing.JLabel jLabel4;
privatejavax.swing.JLabel jLabel5;
privatejavax.swing.JLabel jLabel6;
privatejavax.swing.JLabel jLabel7;
privatejavax.swing.JLabel jLabel8;
privatejavax.swing.JLabel jLabel9;
privatejavax.swing.JButtonjbtncalcular;
privatejavax.swing.JButtonjbtnnuevo;
privatejavax.swing.JButtonjbtnsalir;
privatejavax.swing.JTextFieldjtxtdia;
privatejavax.swing.JTextFieldjtxthora;
privatejavax.swing.JTextField jtxthora2;
privatejavax.swing.JTextFieldjtxthoras;
privatejavax.swing.JTextFieldjtxtminuto;
privatejavax.swing.JTextField jtxtminuto2;
privatejavax.swing.JTextFieldjtxtminutos;
privatejavax.swing.JTextFieldjtxtsegundo;
privatejavax.swing.JTextField jtxtsegundo2;
privatejavax.swing.JTextFieldjtxtsegundos;
  // End of variables declaration
}

More Related Content

What's hot

Developer Testing Tools Roundup
Developer Testing Tools RoundupDeveloper Testing Tools Roundup
Developer Testing Tools Roundup
John Ferguson Smart Limited
 
code for quiz in my sql
code for quiz  in my sql code for quiz  in my sql
code for quiz in my sql
JOYITAKUNDU1
 
The Ring programming language version 1.6 book - Part 72 of 189
The Ring programming language version 1.6 book - Part 72 of 189The Ring programming language version 1.6 book - Part 72 of 189
The Ring programming language version 1.6 book - Part 72 of 189
Mahmoud Samir Fayed
 
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Codemotion
 
What's new in Doctrine
What's new in DoctrineWhat's new in Doctrine
What's new in Doctrine
Jonathan Wage
 
Instant Dynamic Forms with #states
Instant Dynamic Forms with #statesInstant Dynamic Forms with #states
Instant Dynamic Forms with #statesKonstantin Käfer
 
guice-servlet
guice-servletguice-servlet
guice-servlet
Masaaki Yonebayashi
 
Stub you!
Stub you!Stub you!
Stub you!
Andrea Giuliano
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11
Michelangelo van Dam
 
Testing, Performance Analysis, and jQuery 1.4
Testing, Performance Analysis, and jQuery 1.4Testing, Performance Analysis, and jQuery 1.4
Testing, Performance Analysis, and jQuery 1.4
jeresig
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBenelux
Michelangelo van Dam
 
Tools for Development and Debugging in Python
Tools for Development and Debugging in PythonTools for Development and Debugging in Python
Tools for Development and Debugging in Pythonzeeg
 
Android App Development - 05 Action bar
Android App Development - 05 Action barAndroid App Development - 05 Action bar
Android App Development - 05 Action bar
Diego Grancini
 
Тестирование и Django
Тестирование и DjangoТестирование и Django
Тестирование и Django
MoscowDjango
 
How te bring common UI patterns to ADF
How te bring common UI patterns to ADFHow te bring common UI patterns to ADF
How te bring common UI patterns to ADF
Getting value from IoT, Integration and Data Analytics
 
Wicket KT part 2
Wicket KT part 2Wicket KT part 2
Wicket KT part 2
stuq
 
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(上)
JCConf 2015  - 輕鬆學google的雲端開發 - Google App Engine入門(上)JCConf 2015  - 輕鬆學google的雲端開發 - Google App Engine入門(上)
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(上)
Simon Su
 
Php reference sheet
Php reference sheetPhp reference sheet
Php reference sheet
Silvia Rios
 

What's hot (20)

Developer Testing Tools Roundup
Developer Testing Tools RoundupDeveloper Testing Tools Roundup
Developer Testing Tools Roundup
 
code for quiz in my sql
code for quiz  in my sql code for quiz  in my sql
code for quiz in my sql
 
The Ring programming language version 1.6 book - Part 72 of 189
The Ring programming language version 1.6 book - Part 72 of 189The Ring programming language version 1.6 book - Part 72 of 189
The Ring programming language version 1.6 book - Part 72 of 189
 
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
 
What's new in Doctrine
What's new in DoctrineWhat's new in Doctrine
What's new in Doctrine
 
Instant Dynamic Forms with #states
Instant Dynamic Forms with #statesInstant Dynamic Forms with #states
Instant Dynamic Forms with #states
 
guice-servlet
guice-servletguice-servlet
guice-servlet
 
Easy Button
Easy ButtonEasy Button
Easy Button
 
Stub you!
Stub you!Stub you!
Stub you!
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11
 
Testing, Performance Analysis, and jQuery 1.4
Testing, Performance Analysis, and jQuery 1.4Testing, Performance Analysis, and jQuery 1.4
Testing, Performance Analysis, and jQuery 1.4
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBenelux
 
Action bar
Action barAction bar
Action bar
 
Tools for Development and Debugging in Python
Tools for Development and Debugging in PythonTools for Development and Debugging in Python
Tools for Development and Debugging in Python
 
Android App Development - 05 Action bar
Android App Development - 05 Action barAndroid App Development - 05 Action bar
Android App Development - 05 Action bar
 
Тестирование и Django
Тестирование и DjangoТестирование и Django
Тестирование и Django
 
How te bring common UI patterns to ADF
How te bring common UI patterns to ADFHow te bring common UI patterns to ADF
How te bring common UI patterns to ADF
 
Wicket KT part 2
Wicket KT part 2Wicket KT part 2
Wicket KT part 2
 
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(上)
JCConf 2015  - 輕鬆學google的雲端開發 - Google App Engine入門(上)JCConf 2015  - 輕鬆學google的雲端開發 - Google App Engine入門(上)
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(上)
 
Php reference sheet
Php reference sheetPhp reference sheet
Php reference sheet
 

Similar to To change this template

In Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfIn Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdf
flashfashioncasualwe
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdf
fathimaoptical
 
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdfPLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
mohammedfootwear
 
Registro de venta
Registro de ventaRegistro de venta
Registro de venta
lupe ga
 
Chap1 1 4
Chap1 1 4Chap1 1 4
Chap1 1 4
Hemo Chella
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 SpringKiyotaka Oku
 
Groovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonGroovy-er desktop applications with Griffon
Groovy-er desktop applications with Griffon
Eric Wendelin
 
Groovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonGroovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With Griffon
Matthew McCullough
 
jrubykaigi2010-lt-rubeus
jrubykaigi2010-lt-rubeusjrubykaigi2010-lt-rubeus
jrubykaigi2010-lt-rubeus
Takeshi AKIMA
 
correct the error and add code same in the pic import jav.pdf
correct the error and add code same in the pic   import jav.pdfcorrect the error and add code same in the pic   import jav.pdf
correct the error and add code same in the pic import jav.pdf
devangmittal4
 
Java GUI PART II
Java GUI PART IIJava GUI PART II
Java GUI PART II
OXUS 20
 
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdfpackage net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
sudhirchourasia86
 
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
AliHaiderCheema2
 
Java!!!!!Create a program that authenticates username and password.pdf
Java!!!!!Create a program that authenticates username and password.pdfJava!!!!!Create a program that authenticates username and password.pdf
Java!!!!!Create a program that authenticates username and password.pdf
arvindarora20042013
 
TY.BSc.IT Java QB U2
TY.BSc.IT Java QB U2TY.BSc.IT Java QB U2
TY.BSc.IT Java QB U2
Lokesh Singrol
 
College management system.pptx
College management system.pptxCollege management system.pptx
College management system.pptx
ManujArora3
 
Chap1 1.4
Chap1 1.4Chap1 1.4
Chap1 1.4
Hemo Chella
 
How do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdfHow do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdf
forwardcom41
 
Othello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdfOthello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdf
arccreation001
 

Similar to To change this template (20)

In Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfIn Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdf
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdf
 
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdfPLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
 
Registro de venta
Registro de ventaRegistro de venta
Registro de venta
 
Chap1 1 4
Chap1 1 4Chap1 1 4
Chap1 1 4
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
 
Groovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonGroovy-er desktop applications with Griffon
Groovy-er desktop applications with Griffon
 
Groovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonGroovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With Griffon
 
jrubykaigi2010-lt-rubeus
jrubykaigi2010-lt-rubeusjrubykaigi2010-lt-rubeus
jrubykaigi2010-lt-rubeus
 
correct the error and add code same in the pic import jav.pdf
correct the error and add code same in the pic   import jav.pdfcorrect the error and add code same in the pic   import jav.pdf
correct the error and add code same in the pic import jav.pdf
 
Java GUI PART II
Java GUI PART IIJava GUI PART II
Java GUI PART II
 
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdfpackage net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
 
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
 
Java!!!!!Create a program that authenticates username and password.pdf
Java!!!!!Create a program that authenticates username and password.pdfJava!!!!!Create a program that authenticates username and password.pdf
Java!!!!!Create a program that authenticates username and password.pdf
 
TY.BSc.IT Java QB U2
TY.BSc.IT Java QB U2TY.BSc.IT Java QB U2
TY.BSc.IT Java QB U2
 
College management system.pptx
College management system.pptxCollege management system.pptx
College management system.pptx
 
Chap1 1.4
Chap1 1.4Chap1 1.4
Chap1 1.4
 
Deep dive into Oracle ADF
Deep dive into Oracle ADFDeep dive into Oracle ADF
Deep dive into Oracle ADF
 
How do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdfHow do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdf
 
Othello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdfOthello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdf
 

Recently uploaded

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 

Recently uploaded (20)

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 

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());
  • 3. getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(160, 160, 160) .addComponent(jLabel10) .addGap(31, 31, 31) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(10, 10, 10) .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(60, 60, 60) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(30, 30, 30) .addComponent(jtxthora, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(20, 20, 20) .addComponent(jtxtminuto, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(20, 20, 20) .addComponent(jtxtsegundo, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(60, 60, 60) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(40, 40, 40) .addComponent(jtxthora2, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(20, 20, 20) .addComponent(jtxtminuto2, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(20, 20, 20) .addComponent(jtxtsegundo2, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(50, 50, 50) .addComponent(jbtnnuevo) .addGap(33, 33, 33) .addComponent(jbtncalcular, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(20, 20, 20) .addComponent(jbtnsalir)) .addGroup(layout.createSequentialGroup() .addGap(50, 50, 50) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(60, 60, 60)
  • 4. .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(40, 40, 40) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(30, 30, 30) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(4, 4, 4) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(50, 50, 50) .addComponent(jtxtdia, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(40, 40, 40) .addComponent(jtxthoras, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(40, 40, 40) .addComponent(jtxtminutos, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(30, 30, 30) .addComponent(jtxtsegundos, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(10, 10, 10) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel10) .addComponent(jLabel8) .addComponent(jLabel9)) .addGap(16, 16, 16) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jtxthora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jtxtminuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jtxtsegundo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(10, 10, 10) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jtxthora2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jtxtminuto2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jtxtsegundo2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(20, 20, 20)
  • 5. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jbtnnuevo) .addComponent(jbtncalcular) .addComponent(jbtnsalir)) .addGap(17, 17, 17) .addComponent(jLabel3) .addGap(16, 16, 16) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel4) .addComponent(jLabel5) .addComponent(jLabel6) .addComponent(jLabel7)) .addGap(16, 16, 16) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jtxtdia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jtxthoras, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jtxtminutos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jtxtsegundos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) ); pack(); }// </editor-fold> private void jtxthoraActionPerformed(java.awt.event.ActionEventevt) { // TODO add your handling code here: } private void jtxtsegundoActionPerformed(java.awt.event.ActionEventevt) { // TODO add your handling code here: } private void jtxtsegundo2ActionPerformed(java.awt.event.ActionEventevt) { // TODO add your handling code here: } private void jbtnnuevoActionPerformed(java.awt.event.ActionEventevt) { jtxtminuto.setText(null); jtxtsegundo.setText(""); jtxthora2.setText(null); jtxtminuto2.setText(null); jtxtsegundo2.setText(null); jtxtdia.setText(null); jtxthoras.setText(null); jtxtminutos.setText(null); jtxtsegundos.setText(null); jbtnnuevo.requestFocus(); // TODO add your handling code here: } private void jtxthorasActionPerformed(java.awt.event.ActionEventevt) { // TODO add your handling code here: } private void jtxtsegundosActionPerformed(java.awt.event.ActionEventevt) { // TODO add your handling code here:
  • 6. } private void jbtncalcularActionPerformed(java.awt.event.ActionEventevt) { int h1, m1, s1, h2, m2, s2, dt,th, tm, ts, ma, ha, da; h1=Integer.parseInt(jtxthora.getText()); m1=Integer.parseInt(jtxtminuto.getText()); s1=Integer.parseInt(jtxtsegundo.getText()); h2=Integer.parseInt(jtxthora2.getText()); m2=Integer.parseInt(jtxtminuto2.getText()); s2=Integer.parseInt(jtxtsegundo2.getText()); ts=(s1+s2)%60; ma=(s1+s2)/60; tm=(m1+m2+ma)%60; ha=(m1+m2+ma)/60; th=(h1+h2+ha)%24; da=(h1+h2+ha)/24; dt=da; jtxtdia.setText(String.valueOf(dt)); jtxthoras.setText(String.valueOf(th)); jtxtminutos.setText(String.valueOf(tm)); jtxtsegundos.setText(String.valueOf(ts)); jbtnnuevo.requestFocus(); } private void jbtnsalirActionPerformed(java.awt.event.ActionEventevt) { System.exit(0); // TODO add your handling code here: } /** * @paramargs the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ejercicio5().setVisible(true); } }); } // Variables declaration - do not modify privatejavax.swing.JLabel jLabel1; privatejavax.swing.JLabel jLabel10; privatejavax.swing.JLabel jLabel2; privatejavax.swing.JLabel jLabel3; privatejavax.swing.JLabel jLabel4; privatejavax.swing.JLabel jLabel5; privatejavax.swing.JLabel jLabel6; privatejavax.swing.JLabel jLabel7; privatejavax.swing.JLabel jLabel8; privatejavax.swing.JLabel jLabel9; privatejavax.swing.JButtonjbtncalcular; privatejavax.swing.JButtonjbtnnuevo; privatejavax.swing.JButtonjbtnsalir; privatejavax.swing.JTextFieldjtxtdia; privatejavax.swing.JTextFieldjtxthora;