Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Persona cliente;
/**
*/
public cajeroAutomatico() {
initComponents();
/**
*/
if (Arrays.asList(t).contains(b)){
return Arrays.asList(t).indexOf(b);
else{
return -1;
/**
* 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
*/
@SuppressWarnings("unchecked")
jButton1.setText("jButton1");
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("CajeroAutomatico");
btnRetirar.setMnemonic('R');
btnRetirar.setText("Retirar");
btnRetirar.addActionListener(new java.awt.event.ActionListener() {
btnRetirarActionPerformed(evt);
});
btnDepositar.setMnemonic('D');
btnDepositar.setText("Depositar");
btnDepositar.addActionListener(new java.awt.event.ActionListener() {
btnDepositarActionPerformed(evt);
});
btnSaldo.setText("Saldo");
btnSaldo.addActionListener(new java.awt.event.ActionListener() {
btnSaldoActionPerformed(evt);
});
jLabel1.setText("Numero de cuenta");
btnBuscar.setMnemonic('B');
btnBuscar.setText("Buscar");
btnBuscar.addActionListener(new java.awt.event.ActionListener() {
btnBuscarActionPerformed(evt);
});
lblTitular.setText("Titular:");
jLabel2.setText("Cantidad");
txtCantidad.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
txtCantidad.setText("0");
lblNuevoSaldo.setText("Nuevo Saldo:");
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addComponent(txtNumeroCuenta)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(lblTitular, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtCantidad))
.addComponent(lblNuevoSaldo, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
.addComponent(btnRetirar, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnDepositar, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnSaldo, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel1)
.addComponent(txtNumeroCuenta, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblTitular))
.addComponent(btnBuscar))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblSaldo)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
.addGroup(layout.createSequentialGroup()
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtCantidad, 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(lblNuevoSaldo)
pack();
setLocationRelativeTo(null);
}// </editor-fold>
cuentaBancaria cuenta;
int indice;
cuenta.setNumeroCuenta(txtNumeroCuenta.getText());
indice = buscaCuenta(tarjetas,cuenta);
lblTitular.setText("Titular: "+tarjetas[indice].getTitular().getNombre());
lblSaldo.setText("Saldo: "+tarjetas[indice].getSaldo());
else{
cuentaBancaria cuenta;
int indice;
cuenta.setNumeroCuenta(txtNumeroCuenta.getText());
indice = buscaCuenta(tarjetas,cuenta);
if (indice > -1){
tarjetas[indice].depositar(Float.parseFloat(txtCantidad.getText()));
lblNuevoSaldo.setText("NuevoSaldo: "+tarjetas[indice].getSaldo());
else{
cuentaBancaria cuenta;
int indice;
cuenta.setNumeroCuenta(txtNumeroCuenta.getText());
indice = buscaCuenta(tarjetas,cuenta);
tarjetas[indice].retirar(Float.parseFloat(txtCantidad.getText()));
lblNuevoSaldo.setText("NuevoSaldo: "+tarjetas[indice].getSaldo());
else{
cuentaBancaria cuenta;
int indice;
cuenta = new cuentaBancaria();
cuenta.setNumeroCuenta(txtNumeroCuenta.getText());
indice = buscaCuenta(tarjetas,cuenta);
tarjetas[indice].verSaldo();
else{
/**
*/
//<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.
*/
try {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
java.util.logging.Logger.getLogger(cajeroAutomatico.class.getName()).log(java.util.logging.Level.SE
VERE, null, ex);
java.util.logging.Logger.getLogger(cajeroAutomatico.class.getName()).log(java.util.logging.Level.SE
VERE, null, ex);
java.util.logging.Logger.getLogger(cajeroAutomatico.class.getName()).log(java.util.logging.Level.SE
VERE, null, ex);
//</editor-fold>
java.awt.EventQueue.invokeLater(new Runnable() {
new cajeroAutomatico().setVisible(true);
});