Calculadora en netbeans

Solo disponible en BuenasTareas
  • Páginas : 8 (1869 palabras )
  • Descarga(s) : 0
  • Publicado : 13 de febrero de 2011
Leer documento completo
Vista previa del texto
/*

* To change this template, choose Tools | Templates

* and open the template in the editor.

*/

/*

* Calculador.java

*

* Created on 13/02/2011, 04:16:06 PM

*/

/**

*

* @author Anthony

*/

import javax.microedition.midlet.*;

public class Calculador extends javax.swing.JFrame {

//Variables

double sumaresta;

double firstDouble;

doublesecondDouble;

double totalDoble;

//click en los botones

int sumaClick;

int restaClick;

int multiplicaClick;

int divideClick;

/** Creates new form Calculador */

public Calculador() {

initComponents();

}

/** This method is called from within the constructor to

* initialize the form.

* WARNING: Do NOT modify this code. Thecontent of this method is

* always regenerated by the Form Editor.

*/

@SuppressWarnings("unchecked")

//

private void initComponents() {

jPanel1 = new javax.swing.JPanel();

jButton1 = new javax.swing.JButton();

jButton2 = new javax.swing.JButton();

jButton3 = new javax.swing.JButton();

jButton4 = newjavax.swing.JButton();

jButton5 = new javax.swing.JButton();

jButton6 = new javax.swing.JButton();

suma = new javax.swing.JButton();

jButton8 = new javax.swing.JButton();

resta = new javax.swing.JButton();

jButton10 = new javax.swing.JButton();

jButton11 = new javax.swing.JButton();

multiplica = newjavax.swing.JButton();

jButton13 = new javax.swing.JButton();

decimal = new javax.swing.JButton();

divide = new javax.swing.JButton();

negativo = new javax.swing.JButton();

igual = new javax.swing.JButton();

pantalla = new javax.swing.JTextField();

jButton7 = new javax.swing.JButton();setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jPanel1.setBorder(new javax.swing.border.MatteBorder(null));

jButton1.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N

jButton1.setText("1");

jButton1.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {jButton1ActionPerformed(evt);

}

});

jButton2.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N

jButton2.setText("5");

jButton2.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jButton2ActionPerformed(evt);

}

});jButton3.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N

jButton3.setText("4");

jButton3.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jButton3ActionPerformed(evt);

}

});

jButton4.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18NjButton4.setText("3");

jButton4.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jButton4ActionPerformed(evt);

}

});

jButton5.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N

jButton5.setText("7");jButton5.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jButton5ActionPerformed(evt);

}

});

jButton6.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N

jButton6.setText("8");

jButton6.addActionListener(new java.awt.event.ActionListener() {...
tracking img