ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Calculadore neatbeans


Enviado por   •  28 de Julio de 2019  •  Prácticas o problemas  •  2.516 Palabras (11 Páginas)  •  161 Visitas

Página 1 de 11

public class cal extends javax.swing.JFrame {

int a,b,c,m;

/** Creates new form cal */

public cal() {

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() {

jLabel1 = new javax.swing.JLabel();

dato1 = new javax.swing.JTextField();

dato2 = new javax.swing.JTextField();

resultado = new javax.swing.JLabel();

suma = new javax.swing.JButton();

resta = new javax.swing.JButton();

multiplicacion = new javax.swing.JButton();

division = new javax.swing.JButton();

jLabel3 = new javax.swing.JLabel();

borrar = new javax.swing.JButton();

memoria = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N

jLabel1.setForeground(new java.awt.Color(51, 51, 255));

jLabel1.setText("calculadora");

resultado.setFont(new java.awt.Font("Tahoma", 0, 48)); // NOI18N

resultado.setForeground(new java.awt.Color(0, 0, 255));

suma.setText("+");

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

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

sumaActionPerformed(evt);

}

});

resta.setText("-");

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

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

restaActionPerformed(evt);

}

});

multiplicacion.setText("*");

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

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

multiplicacionActionPerformed(evt);

}

});

division.setText("/");

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

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

divisionActionPerformed(evt);

}

});

jLabel3.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N

jLabel3.setForeground(new java.awt.Color(51, 0, 255));

jLabel3.setText("resultado");

borrar.setText("c");

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

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

borrarActionPerformed(evt);

}

});

memoria.setText("m");

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

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

memoriaActionPerformed(evt);

}

});

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(29, 29, 29)

.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)

.addContainerGap(105,

...

Descargar como (para miembros actualizados)  txt (10.3 Kb)   pdf (44.3 Kb)   docx (11.4 Kb)  
Leer 10 páginas más »
Disponible sólo en Clubensayos.com