Calculadora

Páginas: 9 (2151 palabras) Publicado: 6 de enero de 2013
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* interfaz.java
*
* Created on Jun 23, 2010, 4:19:34 PM
*/

/**
*
* @author colombiano
*/
public class interfaz extends javax.swing.JFrame {

float var1,var2;
boolean suma,resta,mult,div;
/** Creates new form interfaz */
public interfaz() {initComponents();

//se declara como falso porque aun no se hace ninguna operacion
suma=false;
resta=false;
mult=false;
div=false;
}

/** 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 FormEditor.
*/
@SuppressWarnings("unchecked")
// //GEN-BEGIN:initComponents
private void initComponents() {

textoRESULTADO = new javax.swing.JTextField();
numero1 = new javax.swing.JButton();
numero2 = new javax.swing.JButton();
numero3 = new javax.swing.JButton();
numero6 = new javax.swing.JButton();
numero5 = newjavax.swing.JButton();
numero4 = new javax.swing.JButton();
numero9 = new javax.swing.JButton();
numero8 = new javax.swing.JButton();
numero7 = new javax.swing.JButton();
numero0 = new javax.swing.JButton();
botonIGUAL = new javax.swing.JButton();
botonSUMAR = new javax.swing.JButton();
botonRESTAR = new javax.swing.JButton();botonDIV = new javax.swing.JButton();
botonMULT = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
botonLIMPIAR = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

numero1.setText("1");
numero1.addActionListener(new java.awt.event.ActionListener() {
publicvoid actionPerformed(java.awt.event.ActionEvent evt) {
numero1ActionPerformed(evt);
}
});

numero2.setText("2");
numero2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
numero2ActionPerformed(evt);
}
});numero3.setText("3");
numero3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
numero3ActionPerformed(evt);
}
});

numero6.setText("6");
numero6.addActionListener(new java.awt.event.ActionListener() {
public voidactionPerformed(java.awt.event.ActionEvent evt) {
numero6ActionPerformed(evt);
}
});

numero5.setText("5");
numero5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
numero5ActionPerformed(evt);
}
});

numero4.setText("4");numero4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
numero4ActionPerformed(evt);
}
});

numero9.setText("9");
numero9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {numero9ActionPerformed(evt);
}
});

numero8.setText("8");
numero8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
numero8ActionPerformed(evt);
}
});

numero7.setText("7");
numero7.addActionListener(new...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Calculo
  • Calculo
  • Calculos
  • Calculo
  • Calculo
  • Calculo
  • Calculo
  • Calculo

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS