CODIGO
CODIGO
CODIGO
import Sistema.sistemaCajero;
import javax.swing.JOptionPane;
double nuevaCantidad = 0;
String nuevoNumero;
public cajero() {
initComponents();
txt_nombre.setText("");
txt_cantidad.setText("");
panel_opcion.setVisible(false);
btn_depositar.setEnabled(false);
btn_retirar.setEnabled(false);
btn_salir.setEnabled(false);
btn_1.setEnabled(false);
btn_2.setEnabled(false);
btn_3.setEnabled(false);
btn_4.setEnabled(false);
btn_5.setEnabled(false);
btn_6.setEnabled(false);
btn_7.setEnabled(false);
btn_8.setEnabled(false);
btn_9.setEnabled(false);
btn_0.setEnabled(false);
btn_cancelar.setEnabled(false);
btn_borrar.setEnabled(false);
btn_aceptar.setEnabled(false);
@SuppressWarnings("unchecked")
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.
RAISED));
jPanel7.setBorder(javax.swing.BorderFactory.createEtchedBorder());
btn_1.setText("1");
btn_1.addActionListener(new java.awt.event.ActionListener() {
btn_1ActionPerformed(evt);
});
btn_3.setText("3");
btn_3.addActionListener(new java.awt.event.ActionListener() {
btn_3ActionPerformed(evt);
}
});
btn_2.setText("2");
btn_2.addActionListener(new java.awt.event.ActionListener() {
btn_2ActionPerformed(evt);
});
btn_7.setText("7");
btn_7.addActionListener(new java.awt.event.ActionListener() {
btn_7ActionPerformed(evt);
});
btn_4.setText("4");
btn_4.addActionListener(new java.awt.event.ActionListener() {
btn_4ActionPerformed(evt);
});
btn_5.setBackground(new java.awt.Color(153, 153, 153));
btn_5.setText("5");
btn_5.addActionListener(new java.awt.event.ActionListener() {
btn_5ActionPerformed(evt);
});
btn_6.setText("6");
btn_6.addActionListener(new java.awt.event.ActionListener() {
btn_6ActionPerformed(evt);
});
btn_8.setText("8");
btn_8.addActionListener(new java.awt.event.ActionListener() {
btn_8ActionPerformed(evt);
});
btn_9.addActionListener(new java.awt.event.ActionListener() {
btn_9ActionPerformed(evt);
});
btn_0.setText("0");
btn_0.addActionListener(new java.awt.event.ActionListener() {
btn_0ActionPerformed(evt);
});
btn_borrar.setText("Borrar");
btn_borrar.addActionListener(new java.awt.event.ActionListener() {
btn_borrarActionPerformed(evt);
});
btn_cancelar.setText("Cancelar ");
btn_cancelar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_cancelarActionPerformed(evt);
});
btn_aceptar.setText("Aceptar");
btn_aceptar.addActionListener(new java.awt.event.ActionListener() {
btn_aceptarActionPerformed(evt);
});
jPanel8.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.
RAISED));
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 9, Short.MAX_VALUE)
);
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)
);
javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
jPanel7.setLayout(jPanel7Layout);
jPanel7Layout.setHorizontalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(jPanel7Layout.createSequentialGroup()
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.T
RAILING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGap(6, 6, 6)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel7Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30,
Short.MAX_VALUE)
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(btn_borrar, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btn_aceptar, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel7Layout.setVerticalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG, false)
.addGroup(jPanel7Layout.createSequentialGroup()
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addContainerGap(11, Short.MAX_VALUE))
);
btn_ingresar.setText("Ingresar");
btn_ingresar.addActionListener(new java.awt.event.ActionListener() {
btn_ingresarActionPerformed(evt);
});
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn_ingresar, javax.swing.GroupLayout.PREFERRED_SIZE, 117,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILI
NG)
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("Bienvenido");
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel5.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.
RAISED));
jPanel6.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabel2.setText("Usuario:");
txt_nombre.setText("Nombre");
jLabel4.setFont(new java.awt.Font("Segoe UI", 0, 18)); // NOI18N
jLabel4.setText("Saldo:");
jLabel5.setText("$");
txt_saldo.setText("0.00");
jButton18.setText("Depositar");
jButton19.setText("Retirar");
jButton19.addActionListener(new java.awt.event.ActionListener() {
jButton19ActionPerformed(evt);
});
jButton20.setText("Salir");
jButton20.addActionListener(new java.awt.event.ActionListener() {
jButton20ActionPerformed(evt);
}
});
panel_opcion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0,
153, 0), 2));
txt_opcion.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
txt_opcion.setText("Opcion");
txt_cantidad.setText("Cantidad");
txt_cantidad.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(51,
153, 0)));
panel_opcion.setLayout(panel_opcionLayout);
panel_opcionLayout.setHorizontalGroup(
panel_opcionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panel_opcionLayout.createSequentialGroup()
.addContainerGap()
.addGroup(panel_opcionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.
LEADING)
.addComponent(txt_cantidad, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(txt_opcion, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
panel_opcionLayout.setVerticalGroup(
panel_opcionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panel_opcionLayout.createSequentialGroup()
.addComponent(txt_opcion)
.addComponent(txt_cantidad)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel6.setLayout(jPanel6Layout);
jPanel6Layout.setHorizontalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(jPanel6Layout.createSequentialGroup()
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.L
EADING, false)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.L
EADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txt_nombre, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel6Layout.createSequentialGroup()
.addComponent(panel_opcion, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.L
EADING)
.addComponent(jButton18, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jButton19)
.addComponent(jButton20))))
.addContainerGap())
);
jPanel6Layout.setVerticalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG, false)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(txt_nombre, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jLabel5)
.addComponent(txt_saldo, javax.swing.GroupLayout.PREFERRED_SIZE, 31,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(jPanel6Layout.createSequentialGroup()
.addComponent(jButton18)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton19)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 74,
Short.MAX_VALUE)
.addComponent(jButton20))
.addComponent(panel_opcion, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
btn_depositar.setText("<");
btn_depositar.addActionListener(new java.awt.event.ActionListener() {
btn_depositarActionPerformed(evt);
});
btn_salir.setText("<");
btn_salir.addActionListener(new java.awt.event.ActionListener() {
btn_salirActionPerformed(evt);
});
btn_retirar.setText("<");
btn_retirar.addActionListener(new java.awt.event.ActionListener() {
});
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.L
EADING)
.addContainerGap())
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(jPanel3Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(12, Short.MAX_VALUE))
.addGroup(jPanel3Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>
if(txt_cantidad.getText().equals("")){
txt_cantidad.setText("");
txt_cantidad.setText(nuevoNumero);
else{
txt_cantidad.setText(nuevoNumero);
txt_cantidad.setText("");
txt_nombre.setText(JOptionPane.showInputDialog("Ingrese su nombre."));
btn_ingresar.setEnabled(false);
btn_depositar.setEnabled(true);
btn_retirar.setEnabled(true);
btn_salir.setEnabled(true);
opcionDepositar = true;
btn_retirar.setEnabled(false);
btn_depositar.setEnabled(false);
panel_opcion.setVisible(true);
btn_1.setEnabled(true);
btn_2.setEnabled(true);
btn_3.setEnabled(true);
btn_4.setEnabled(true);
btn_5.setEnabled(true);
btn_6.setEnabled(true);
btn_7.setEnabled(true);
btn_8.setEnabled(true);
btn_9.setEnabled(true);
btn_0.setEnabled(true);
btn_cancelar.setEnabled(true);
btn_borrar.setEnabled(true);
btn_aceptar.setEnabled(true);
opcionDepositar = false;
opcionRetirar = false;
panel_opcion.setVisible(false);
btn_depositar.setEnabled(true);
btn_retirar.setEnabled(true);
btn_1.setEnabled(false);
btn_2.setEnabled(false);
btn_3.setEnabled(false);
btn_4.setEnabled(false);
btn_5.setEnabled(false);
btn_6.setEnabled(false);
btn_7.setEnabled(false);
btn_8.setEnabled(false);
btn_9.setEnabled(false);
btn_0.setEnabled(false);
btn_cancelar.setEnabled(false);
btn_borrar.setEnabled(false);
btn_aceptar.setEnabled(false);
txt_cantidad.setText("");
else{
System.exit(0);
opcionRetirar = true;
btn_retirar.setEnabled(false);
btn_depositar.setEnabled(false);
panel_opcion.setVisible(true);
btn_1.setEnabled(true);
btn_2.setEnabled(true);
btn_3.setEnabled(true);
btn_4.setEnabled(true);
btn_5.setEnabled(true);
btn_6.setEnabled(true);
btn_7.setEnabled(true);
btn_8.setEnabled(true);
btn_9.setEnabled(true);
btn_0.setEnabled(true);
btn_cancelar.setEnabled(true);
btn_borrar.setEnabled(true);
btn_aceptar.setEnabled(true);
if(txt_cantidad.getText().equals("")){
txt_cantidad.setText("");
txt_cantidad.setText(nuevoNumero);
else{
txt_cantidad.setText(nuevoNumero);
if(txt_cantidad.getText().equals("")){
txt_cantidad.setText("");
txt_cantidad.setText(nuevoNumero);
}
else{
txt_cantidad.setText(nuevoNumero);
if(txt_cantidad.getText().equals("")){
txt_cantidad.setText("");
txt_cantidad.setText(nuevoNumero);
else{
txt_cantidad.setText(nuevoNumero);
if(txt_cantidad.getText().equals("")){
txt_cantidad.setText("");
txt_cantidad.setText(nuevoNumero);
else{
nuevoNumero = txt_cantidad.getText() + "4";
txt_cantidad.setText(nuevoNumero);
if(txt_cantidad.getText().equals("")){
txt_cantidad.setText("");
txt_cantidad.setText(nuevoNumero);
else{
txt_cantidad.setText(nuevoNumero);
if(txt_cantidad.getText().equals("")){
txt_cantidad.setText("");
txt_cantidad.setText(nuevoNumero);
else{
txt_cantidad.setText(nuevoNumero);
}
}
if(txt_cantidad.getText().equals("")){
txt_cantidad.setText("");
txt_cantidad.setText(nuevoNumero);
else{
txt_cantidad.setText(nuevoNumero);
if(txt_cantidad.getText().equals("")){
txt_cantidad.setText("");
txt_cantidad.setText(nuevoNumero);
else{
txt_cantidad.setText(nuevoNumero);
txt_cantidad.setText("");
txt_cantidad.setText(nuevoNumero);
else{
txt_cantidad.setText(nuevoNumero);
if(txt_cantidad.getText().equals("")){
txt_cantidad.setText("");
if(txt_cantidad.getText().equals("")){
opcionDepositar = false;
opcionRetirar = false;
panel_opcion.setVisible(false);
btn_depositar.setEnabled(true);
btn_retirar.setEnabled(true);
txt_cantidad.setText("");
btn_1.setEnabled(false);
btn_2.setEnabled(false);
btn_3.setEnabled(false);
btn_4.setEnabled(false);
btn_5.setEnabled(false);
btn_6.setEnabled(false);
btn_7.setEnabled(false);
btn_8.setEnabled(false);
btn_9.setEnabled(false);
btn_0.setEnabled(false);
btn_cancelar.setEnabled(false);
btn_borrar.setEnabled(false);
btn_aceptar.setEnabled(false);
opcionDepositar = false;
nuevaCantidad = Double.parseDouble(String.valueOf(txt_cantidad.getText()));
cajero.depositar(nuevaCantidad);
txt_saldo.setText(String.valueOf(cajero.obtenerSaldo()));
panel_opcion.setVisible(false);
txt_cantidad.setText("");
btn_depositar.setEnabled(true);
btn_retirar.setEnabled(true);
btn_1.setEnabled(false);
btn_2.setEnabled(false);
btn_3.setEnabled(false);
btn_4.setEnabled(false);
btn_5.setEnabled(false);
btn_6.setEnabled(false);
btn_7.setEnabled(false);
btn_8.setEnabled(false);
btn_9.setEnabled(false);
btn_0.setEnabled(false);
btn_cancelar.setEnabled(false);
btn_borrar.setEnabled(false);
btn_aceptar.setEnabled(false);
opcionRetirar = false;
nuevaCantidad = Double.parseDouble(String.valueOf(txt_cantidad.getText()));
cajero.retirar(nuevaCantidad);
txt_saldo.setText(String.valueOf(cajero.obtenerSaldo()));
panel_opcion.setVisible(false);
txt_cantidad.setText("");
btn_depositar.setEnabled(true);
btn_retirar.setEnabled(true);
btn_1.setEnabled(false);
btn_2.setEnabled(false);
btn_3.setEnabled(false);
btn_4.setEnabled(false);
btn_5.setEnabled(false);
btn_6.setEnabled(false);
btn_7.setEnabled(false);
btn_8.setEnabled(false);
btn_9.setEnabled(false);
btn_0.setEnabled(false);
btn_cancelar.setEnabled(false);
btn_borrar.setEnabled(false);
btn_aceptar.setEnabled(false);
/**
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
java.util.logging.Logger.getLogger(cajero.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
java.util.logging.Logger.getLogger(cajero.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
java.util.logging.Logger.getLogger(cajero.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
java.util.logging.Logger.getLogger(cajero.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
//</editor-fold>
java.awt.EventQueue.invokeLater(new Runnable() {
});
package Sistema;
import javax.swing.JOptionPane;
public sistemaCajero(){
saldoActual = 0;
saldoActual += deposito;
saldoActual -= retiro;
else{
return saldoActual;