SlideShare uma empresa Scribd logo
1 de 7
/*
 * 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
}

Mais conteúdo relacionado

Mais procurados

Instant Dynamic Forms with #states
Instant Dynamic Forms with #statesInstant Dynamic Forms with #states
Instant Dynamic Forms with #states
Konstantin Käfer
 
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
zeeg
 

Mais procurados (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
 

Semelhante a 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
 
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
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
Kiyotaka Oku
 
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
 
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
 
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
 

Semelhante a 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
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

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;