Calculadora En Java
Enviado por Rosy66 • 12 de Noviembre de 2014 • 7.909 Palabras (32 Páginas) • 183 Visitas
package calc;
/**
*
* @author rosa.casillas
*/
public class Calc1 extends javax.swing.JFrame {
String memoria1;
String signo;
String memoria2;
/**
* Creates new form Calc1
*/
public Calc1() {
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() {
txtPantalla = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jButton7 = new javax.swing.JButton();
jButton8 = new javax.swing.JButton();
jButton9 = new javax.swing.JButton();
jButton10 = new javax.swing.JButton();
jButton11 = new javax.swing.JButton();
jButton12 = new javax.swing.JButton();
jButton13 = new javax.swing.JButton();
jButton14 = new javax.swing.JButton();
jButton15 = new javax.swing.JButton();
jButton16 = new javax.swing.JButton();
jButton17 = new javax.swing.JButton();
jButton18 = new javax.swing.JButton();
jButton19 = new javax.swing.JButton();
jButton20 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jButton1.setBackground(new java.awt.Color(51, 51, 255));
jButton1.setForeground(new java.awt.Color(255, 255, 255));
jButton1.setText("1");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setBackground(new java.awt.Color(51, 51, 255));
jButton2.setForeground(new java.awt.Color(255, 255, 255));
jButton2.setText("4");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton3.setBackground(new java.awt.Color(51, 51, 255));
jButton3.setForeground(new java.awt.Color(255, 255, 255));
jButton3.setText("7");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jButton4.setBackground(new java.awt.Color(51, 51, 255));
jButton4.setForeground(new java.awt.Color(255, 255, 255));
jButton4.setText("0");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jButton5.setBackground(new java.awt.Color(51, 51, 255));
jButton5.setForeground(new java.awt.Color(255, 255, 255));
jButton5.setText("2");
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
jButton6.setBackground(new java.awt.Color(51, 51, 255));
jButton6.setForeground(new java.awt.Color(255, 255, 255));
jButton6.setText("5");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
jButton7.setBackground(new java.awt.Color(51, 51, 255));
jButton7.setForeground(new java.awt.Color(255, 255, 255));
jButton7.setText("8");
jButton7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton7ActionPerformed(evt);
}
});
jButton8.setBackground(new java.awt.Color(51, 51, 255));
jButton8.setForeground(new java.awt.Color(255, 255, 255));
jButton8.setText("+/-");
jButton8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton8ActionPerformed(evt);
}
});
jButton9.setBackground(new java.awt.Color(51, 51, 255));
jButton9.setForeground(new java.awt.Color(255, 255, 255));
jButton9.setText("9");
jButton9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton9ActionPerformed(evt);
}
});
jButton10.setBackground(new java.awt.Color(51, 51, 255));
jButton10.setForeground(new java.awt.Color(255, 255, 255));
jButton10.setText("3");
jButton10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton10ActionPerformed(evt);
}
});
jButton11.setBackground(new java.awt.Color(51, 51, 255));
jButton11.setForeground(new java.awt.Color(255, 255, 255));
jButton11.setText("6");
jButton11.addActionListener(new
...