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

Calculadore neatbeans


Enviado por   •  28 de Julio de 2019  •  Práctica o problema  •  2.516 Palabras (11 Páginas)  •  200 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, Short.MAX_VALUE))

.addGroup(layout.createSequentialGroup()

.addContainerGap()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(10, 10, 10)

.addComponent(jLabel3))

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)

.addComponent(resultado, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE)

.addComponent(dato1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE)

.addComponent(dato2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE))

.addGap(8, 8, 8)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(memoria, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE)

.addComponent(borrar, 0, 0, Short.MAX_VALUE)))

.addGroup(layout.createSequentialGroup()

.addComponent(suma, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

.addComponent(resta, javax.swing.GroupLayout.PREFERRED_SIZE,

...

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