Calculadora en java ( jcreator)

Solo disponible en BuenasTareas
  • Páginas : 9 (2164 palabras )
  • Descarga(s) : 0
  • Publicado : 6 de diciembre de 2011
Leer documento completo
Vista previa del texto
/*
* 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")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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 = new javax.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 = newjavax.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(newjava.awt.event.ActionListener() {
public void 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 void actionPerformed(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 voidactionPerformed(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");...
tracking img