Você está na página 1de 20

Cuenta

Bancaria

CLSCLIENTE.JAVA

package prycooperativa.Modelo;
//DECLARACIN DE LAS VARIABLES
public class ClsCliente {
private long _cedula;
private String _nombre;
private String _direccion;
private String _estado;
private ClsCuenta _cuentaAho, _cuentaCte;
//CONSTRUCTORES
public ClsCliente(){
this._cedula = 0;
this._nombre = "";
this._direccion ="";
this._estado = "";
this._cuentaAho = null;
this._cuentaCte = null;
}
//SET Y GET
public ClsCliente(long _cedula, String _nombre, String _direccion, String _estado,
ClsCuenta _ahorro, ClsCuenta _corriente ) {
this._cedula = _cedula;
this._nombre = _nombre;
this._direccion = _direccion;
this._estado = _estado;
this._cuentaAho = _ahorro;
this._cuentaCte = _corriente;
}
public ClsCuenta getCuentaAho() {
return _cuentaAho;
}
public ClsCuenta getCuentaCte() {
return _cuentaCte;
}
public void setCuentaAho(ClsCuenta _cuentaAho) {
this._cuentaAho = _cuentaAho;
}

Por

Mara Alfonsina Trujillo Coral


Programacin Aplicada
Ing. Eddy Ynez

public void setCuentaCte(ClsCuenta _cuentaCte) {


this._cuentaCte = _cuentaCte;
}

public void setCedula(long _cedula) {


this._cedula = _cedula;
}
public void setNombre(String _nombre) {
this._nombre = _nombre;
}
public void setDireccion(String _direccion) {
this._direccion = _direccion;
}
public void setEstado(String _estado) {
this._estado = _estado;
}
public long getCedula() {
return _cedula;
}
public String getNombre() {
return _nombre;
}
public String getDireccion() {
return _direccion;
}
public String getEstado() {
return _estado;
}
}

CLSCLIENTE.JAVA

package prycooperativa.Modelo;
//DECLARACIN DE LAS VARIABLES: TODO REFERENTE A LA CUENTA
public class ClsCuenta {
private long _numCta;
private String _tipo;

private String _estado;


private float _monto;
private long _cedula;
//CONSTRUCTORES
public ClsCuenta(long _numCta, String _tipoCta, String _estado, float _monto, long
_cedula) {
this._numCta = _numCta;
this._tipo = _tipoCta;
this._estado = _estado;
this._monto = _monto;
this._cedula = _cedula;
}
//GET Y SET
public float getMonto() {
return _monto;
}
public void setNumCta(long _numCta) {
this._numCta = _numCta;
}
public void setTipo(String _tipo) {
this._tipo = _tipo;
}
public void setEstado(String _estado) {
this._estado = _estado;
}
public void setMonto(float _monto) {
this._monto = _monto;
}
public void setCedula(long _cedula) {
this._cedula = _cedula;
}
public long getNumCta() {
return _numCta;
}
public String getTipo() {
return _tipo;
}

public String getEstado() {


return _estado;
}
public long getCedula() {
return _cedula;
}
//METODOS
public String depositar(float valor){
if (valor < 100){
_monto += valor;
}
else if (valor <500)
_monto += 1.01*valor;
else if (valor <1000)
_monto += 1.02*valor;
else
_monto += 1.03*valor;
_estado="ACTIVO";
return "Deposito Realizado";
}
public String retirar(float valor){
String resp;
if(valor >_monto){
return "Saldo insuficiente, no puedo realizar el retiro";
}
else if (valor <= 0.9 * _monto) {
_monto -= valor;
return "Retiro realizado";
}
if (valor==_monto){
_monto -= valor;
_estado="INACTIVO";
resp="Retiro realizado,cuenta cerrada";
}
else
resp="Considere el cierre de la Cuenta y retire todo su saldo";
return resp;
}
}

PRYCOOPERATIVA.JAVA

package prycooperativa.Controlador;
import prycooperativa.Vista.*;
public class PryCooperativa {
public static void main(String[] args) {
java.awt.EventQueue.invokeLater( new Runnable() {
public void run()
{
new WinCooperativa().setVisible(true);
}
}
);
}
}

WINCOOPERATIVA.JAVA

package prycooperativa.Vista;
import javax.swing.JOptionPane;
import prycooperativa.Modelo.*;
public class WinCooperativa extends javax.swing.JFrame {
ClsCliente cliente = new ClsCliente();
public WinCooperativa() {
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() {
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
TxtCedula = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
TxtEstado = new javax.swing.JTextField();
TxtNombre = new javax.swing.JTextField();
TxtDireccion = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jLabel11 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
TxtEstado_Aho = new javax.swing.JTextField();
TxtMonto_Aho = new javax.swing.JTextField();
TxtNumCta_Aho = new javax.swing.JTextField();
jLabel19 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
jLabel18 = new javax.swing.JLabel();
TxtNumCta_Cte = new javax.swing.JTextField();
TxtMonto_Cte = new javax.swing.JTextField();
TxtEstado_Cte = new javax.swing.JTextField();
jSeparator2 = new javax.swing.JSeparator();
RBtnTipoCta_Aho = new javax.swing.JRadioButton();

jLabel20 = new javax.swing.JLabel();


RBtnTipoCta_Cte = new javax.swing.JRadioButton();
BtnCrear = new javax.swing.JButton();
BtnDepositar = new javax.swing.JButton();
BtnRetirar = new javax.swing.JButton();
BtnLimpiar = new javax.swing.JButton();
BtnSalir = new javax.swing.JButton();
TxtValor = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("BANCO MELICOND");
setFocusTraversalPolicyProvider(true);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel2.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel2.setText("Cdula:");
getContentPane().add(jLabel2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(13, 38, -1, -1));
jLabel3.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel3.setText("CLIENTE");
getContentPane().add(jLabel3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(13, 11, 121, -1));
TxtCedula.setEditable(false);
TxtCedula.setBackground(new java.awt.Color(153, 153, 255));
TxtCedula.setDisabledTextColor(new java.awt.Color(153, 153, 255));
TxtCedula.setFocusTraversalPolicyProvider(true);
getContentPane().add(TxtCedula, new
org.netbeans.lib.awtextra.AbsoluteConstraints(106, 35, 131, -1));
jLabel6.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel6.setText("Estado");
getContentPane().add(jLabel6, new
org.netbeans.lib.awtextra.AbsoluteConstraints(306, 38, -1, -1));
TxtEstado.setEditable(false);
TxtEstado.setDisabledTextColor(new java.awt.Color(153, 153, 255));
getContentPane().add(TxtEstado, new
org.netbeans.lib.awtextra.AbsoluteConstraints(400, 35, 81, -1));
TxtNombre.setBackground(new java.awt.Color(153, 153, 255));
TxtNombre.setDisabledTextColor(new java.awt.Color(153, 153, 255));
TxtNombre.setFocusTraversalPolicyProvider(true);
getContentPane().add(TxtNombre, new
org.netbeans.lib.awtextra.AbsoluteConstraints(106, 66, 131, -1));

TxtDireccion.setBackground(new java.awt.Color(153, 153, 255));


TxtDireccion.setDisabledTextColor(new java.awt.Color(153, 153, 255));
TxtDireccion.setFocusTraversalPolicyProvider(true);
TxtDireccion.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
TxtDireccionActionPerformed(evt);
}
});
getContentPane().add(TxtDireccion, new
org.netbeans.lib.awtextra.AbsoluteConstraints(106, 97, 131, -1));
jLabel4.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel4.setText("Nombre:");
getContentPane().add(jLabel4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(13, 69, -1, -1));
jLabel5.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel5.setText("Direccin:");
getContentPane().add(jLabel5, new
org.netbeans.lib.awtextra.AbsoluteConstraints(13, 100, -1, -1));
getContentPane().add(jSeparator1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(0, 135, 535, 12));
jLabel11.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel11.setText("CUENTA");
getContentPane().add(jLabel11, new
org.netbeans.lib.awtextra.AbsoluteConstraints(13, 151, 121, -1));
jLabel9.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel9.setText("No Cta. Ahorro:");
getContentPane().add(jLabel9, new
org.netbeans.lib.awtextra.AbsoluteConstraints(13, 185, -1, -1));
jLabel10.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel10.setText("Monto:");
getContentPane().add(jLabel10, new
org.netbeans.lib.awtextra.AbsoluteConstraints(56, 213, -1, -1));
jLabel15.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel15.setText("Estado:");
getContentPane().add(jLabel15, new
org.netbeans.lib.awtextra.AbsoluteConstraints(53, 242, -1, -1));
TxtEstado_Aho.setEditable(false);
TxtEstado_Aho.setDisabledTextColor(new java.awt.Color(153, 153, 255));
TxtEstado_Aho.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {

TxtEstado_AhoActionPerformed(evt);
}
});
getContentPane().add(TxtEstado_Aho, new
org.netbeans.lib.awtextra.AbsoluteConstraints(144, 239, 74, -1));
TxtMonto_Aho.setEditable(false);
TxtMonto_Aho.setDisabledTextColor(new java.awt.Color(153, 153, 255));
TxtMonto_Aho.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
TxtMonto_AhoActionPerformed(evt);
}
});
getContentPane().add(TxtMonto_Aho, new
org.netbeans.lib.awtextra.AbsoluteConstraints(144, 213, 74, -1));
TxtNumCta_Aho.setBackground(new java.awt.Color(153, 153, 255));
TxtNumCta_Aho.setDisabledTextColor(new java.awt.Color(153, 153, 255));
TxtNumCta_Aho.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
TxtNumCta_AhoActionPerformed(evt);
}
});
getContentPane().add(TxtNumCta_Aho, new
org.netbeans.lib.awtextra.AbsoluteConstraints(144, 182, 74, -1));
jLabel19.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel19.setText("TIPO DE CUENTA");
getContentPane().add(jLabel19, new
org.netbeans.lib.awtextra.AbsoluteConstraints(183, 293, 121, -1));
jLabel16.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel16.setText("No Cta. Corriente:");
getContentPane().add(jLabel16, new
org.netbeans.lib.awtextra.AbsoluteConstraints(259, 185, -1, -1));
jLabel17.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel17.setText("Monto:");
getContentPane().add(jLabel17, new
org.netbeans.lib.awtextra.AbsoluteConstraints(314, 213, -1, -1));
jLabel18.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel18.setText("Estado:");
getContentPane().add(jLabel18, new
org.netbeans.lib.awtextra.AbsoluteConstraints(311, 242, -1, -1));
TxtNumCta_Cte.setBackground(new java.awt.Color(153, 153, 255));

TxtNumCta_Cte.setDisabledTextColor(new java.awt.Color(153, 153, 255));


TxtNumCta_Cte.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
TxtNumCta_CteActionPerformed(evt);
}
});
getContentPane().add(TxtNumCta_Cte, new
org.netbeans.lib.awtextra.AbsoluteConstraints(402, 182, 74, -1));
TxtMonto_Cte.setEditable(false);
TxtMonto_Cte.setDisabledTextColor(new java.awt.Color(153, 153, 255));
getContentPane().add(TxtMonto_Cte, new
org.netbeans.lib.awtextra.AbsoluteConstraints(402, 213, 74, -1));
TxtEstado_Cte.setEditable(false);
TxtEstado_Cte.setDisabledTextColor(new java.awt.Color(153, 153, 255));
getContentPane().add(TxtEstado_Cte, new
org.netbeans.lib.awtextra.AbsoluteConstraints(402, 239, 74, -1));
getContentPane().add(jSeparator2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(0, 277, 535, 10));
RBtnTipoCta_Aho.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
RBtnTipoCta_Aho.setSelected(true);
RBtnTipoCta_Aho.setText("Ahorro");
RBtnTipoCta_Aho.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
RBtnTipoCta_AhoMouseClicked(evt);
}
});
RBtnTipoCta_Aho.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
RBtnTipoCta_AhoActionPerformed(evt);
}
});
getContentPane().add(RBtnTipoCta_Aho, new
org.netbeans.lib.awtextra.AbsoluteConstraints(93, 313, -1, -1));
jLabel20.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
jLabel20.setText("Valor:");
getContentPane().add(jLabel20, new
org.netbeans.lib.awtextra.AbsoluteConstraints(183, 350, -1, -1));
RBtnTipoCta_Cte.setFont(new java.awt.Font("BatangChe", 0, 14)); // NOI18N
RBtnTipoCta_Cte.setText("Corriente");
RBtnTipoCta_Cte.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
RBtnTipoCta_CteMouseClicked(evt);

10

}
});
RBtnTipoCta_Cte.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
RBtnTipoCta_CteActionPerformed(evt);
}
});
getContentPane().add(RBtnTipoCta_Cte, new
org.netbeans.lib.awtextra.AbsoluteConstraints(345, 313, -1, -1));
BtnCrear.setFont(new java.awt.Font("Browallia New", 1, 18)); // NOI18N
BtnCrear.setText("CREAR");
BtnCrear.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
BtnCrearMouseClicked(evt);
}
});
BtnCrear.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BtnCrearActionPerformed(evt);
}
});
getContentPane().add(BtnCrear, new
org.netbeans.lib.awtextra.AbsoluteConstraints(26, 399, -1, -1));
BtnDepositar.setFont(new java.awt.Font("Browallia New", 1, 18)); // NOI18N
BtnDepositar.setText("DEPOSITAR");
BtnDepositar.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
BtnDepositarMouseClicked(evt);
}
});
BtnDepositar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BtnDepositarActionPerformed(evt);
}
});
getContentPane().add(BtnDepositar, new
org.netbeans.lib.awtextra.AbsoluteConstraints(121, 399, -1, -1));
BtnRetirar.setFont(new java.awt.Font("Browallia New", 1, 18)); // NOI18N
BtnRetirar.setText("RETIRAR");
BtnRetirar.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
BtnRetirarMouseClicked(evt);
}
});

11

BtnRetirar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BtnRetirarActionPerformed(evt);
}
});
getContentPane().add(BtnRetirar, new
org.netbeans.lib.awtextra.AbsoluteConstraints(239, 399, -1, -1));
BtnLimpiar.setFont(new java.awt.Font("Browallia New", 1, 18)); // NOI18N
BtnLimpiar.setText("LIMPIAR");
BtnLimpiar.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
BtnLimpiarMouseClicked(evt);
}
});
BtnLimpiar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BtnLimpiarActionPerformed(evt);
}
});
getContentPane().add(BtnLimpiar, new
org.netbeans.lib.awtextra.AbsoluteConstraints(343, 399, -1, -1));
BtnSalir.setFont(new java.awt.Font("Browallia New", 1, 18)); // NOI18N
BtnSalir.setText("SALIR");
BtnSalir.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
BtnSalirMouseClicked(evt);
}
});
BtnSalir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BtnSalirActionPerformed(evt);
}
});
getContentPane().add(BtnSalir, new
org.netbeans.lib.awtextra.AbsoluteConstraints(444, 399, -1, -1));
TxtValor.setBackground(new java.awt.Color(153, 153, 255));
TxtValor.setDisabledTextColor(new java.awt.Color(153, 153, 255));
getContentPane().add(TxtValor, new
org.netbeans.lib.awtextra.AbsoluteConstraints(229, 347, 74, -1));
pack();
}// </editor-fold>
private void TxtEstado_AhoActionPerformed(java.awt.event.ActionEvent evt) {

12

// TODO add your handling code here:


}
private void RBtnTipoCta_AhoActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void RBtnTipoCta_CteActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void BtnCrearMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here: parseInt(TxtPantalla.getText())
//datos del cliente
String resp;
long cedula = Long.parseLong(TxtCedula.getText());
// CREA TEMPORALMENTE CLASES DE CTA AHO Y CTE
ClsCuenta cuentaAho= new
ClsCuenta(Long.parseLong(TxtNumCta_Aho.getText()),
"AHORROS", "ACTIVO", 0, cedula);
ClsCuenta cuentaCte= new
ClsCuenta(Long.parseLong(TxtNumCta_Aho.getText()),"CORRIENTE","ACTIVO", 0,
cedula);
// ASIGNA DATOS A CLASE CLIENTE.
cliente.setCedula(cedula);
cliente.setNombre(TxtNombre.getText());
cliente.setDireccion(TxtDireccion.getText());
cliente.setEstado("ACTIVO");
cliente.setCuentaAho(cuentaAho);
cliente.setCuentaCte(cuentaCte);
// procesar el deposito inicial de apertura de cuenta
float valor = Float.parseFloat(TxtValor.getText());
if (RBtnTipoCta_Aho.isSelected())
resp=cliente.getCuentaAho().depositar(valor);
else
// cta corriente
resp=cliente.getCuentaCte().depositar(valor);
// los datos de las clases cliente y cuentaAho y CuenttaCte
// e imprime en la ventana o pantalla
refrescarWin();
// Imprime mensaje de creacion de cliente y realizacion del deposito
JOptionPane.showMessageDialog(this, "Cuenta creada y "+resp);

13

}
private void BtnDepositarMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
String resp;
float valor = Float.parseFloat(TxtValor.getText());
if (RBtnTipoCta_Aho.isSelected())
resp=cliente.getCuentaAho().depositar(valor);
else
// cta corriente
resp=cliente.getCuentaCte().depositar(valor);
// los datos de las clases cliente y cuentaAho y CuenttaCte
// e imprime en la ventana o pantalla
refrescarWin();
// Imprime mensaje de creacion de cliente y realizacion del deposito
JOptionPane.showMessageDialog(this, resp);
}
private void BtnRetirarMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
String resp;
float valor = Float.parseFloat(TxtValor.getText());
if (RBtnTipoCta_Aho.isSelected())
resp=cliente.getCuentaAho().retirar(valor);
else
// cta corriente
resp=cliente.getCuentaCte().retirar(valor);
// los datos de las clases cliente y cuentaAho y CuenttaCte
// e imprime en la ventana o pantalla
refrescarWin();
// Imprime mensaje de creacion de cliente y realizacion del deposito
JOptionPane.showMessageDialog(this, resp);
}
private void BtnLimpiarMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
int resp; // 0 si, 1 no
resp = JOptionPane.showConfirmDialog(null, "Esta seguro?", "Alerta!",
JOptionPane.YES_NO_OPTION);
if (resp==0) {
TxtCedula.setText(null);
TxtCedula.requestFocus();

14

TxtNombre.setText(null);
TxtNombre.requestFocus();
TxtDireccion.setText(null);
TxtDireccion.requestFocus();
TxtEstado.setText(null);
TxtEstado.requestFocus();
TxtNumCta_Aho.setText(null);
TxtNumCta_Aho.requestFocus();
TxtMonto_Aho.setText(null);
TxtMonto_Aho.requestFocus();
TxtEstado_Aho.setText(null);
TxtEstado_Aho.requestFocus();
TxtNumCta_Cte.setText(null);
TxtNumCta_Cte.requestFocus();
TxtMonto_Cte.setText(null);
TxtMonto_Cte.requestFocus();
TxtEstado_Cte.setText(null);
TxtEstado_Cte.requestFocus();
TxtValor.setText(null);
TxtValor.requestFocus();
RBtnTipoCta_Cte.setSelected(false);
RBtnTipoCta_Aho.setSelected(true);
}
}
private void BtnSalirMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
System.exit(0);
}
private void BtnSalirActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void TxtNumCta_CteActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void BtnLimpiarActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void TxtDireccionActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void BtnCrearActionPerformed(java.awt.event.ActionEvent evt) {

15

// TODO add your handling code here:


}
private void TxtNumCta_AhoActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void BtnDepositarActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void RBtnTipoCta_AhoMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
if (RBtnTipoCta_Aho.isSelected() )
RBtnTipoCta_Cte.setSelected(false);
}
private void RBtnTipoCta_CteMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
if (RBtnTipoCta_Cte.isSelected() )
RBtnTipoCta_Aho.setSelected(false);
}
private void BtnRetirarActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void TxtMonto_AhoActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<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 {

16

for (javax.swing.UIManager.LookAndFeelInfo info :


javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(WinCooperativa.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(WinCooperativa.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(WinCooperativa.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(WinCooperativa.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new WinCooperativa().setVisible(true);
}
});
}
private void refrescarWin(){
// TOMA DATOS DE LA CLASE CLIENTE Y CLASE CTA AHO Y CTE E
IMPRIME EN PANTALLA
String estado_Aho = cliente.getCuentaAho().getEstado();
String estado_Cte = cliente.getCuentaCte().getEstado();
if (estado_Aho=="INACTIVO" && estado_Cte=="INACTIVO")
cliente.setEstado("INACTIVO");
else
cliente.setEstado("ACTIVO");

17

TxtCedula.setText(Long.toString(cliente.getCedula()));
TxtNombre.setText(cliente.getNombre());
TxtDireccion.setText(cliente.getDireccion());
TxtEstado.setText(cliente.getEstado());
TxtNumCta_Aho.setText(Long.toString(cliente.getCuentaAho().getNumCta()));
TxtMonto_Aho.setText(Float.toString(cliente.getCuentaAho().getMonto()));
TxtEstado_Aho.setText(estado_Aho);
TxtNumCta_Cte.setText(Long.toString(cliente.getCuentaCte().getNumCta()));
TxtMonto_Cte.setText(Float.toString(cliente.getCuentaCte().getMonto()));
TxtEstado_Cte.setText(estado_Cte);
TxtValor.setText("");
}
// Variables declaration - do not modify
private javax.swing.JButton BtnCrear;
private javax.swing.JButton BtnDepositar;
private javax.swing.JButton BtnLimpiar;
private javax.swing.JButton BtnRetirar;
private javax.swing.JButton BtnSalir;
private javax.swing.JRadioButton RBtnTipoCta_Aho;
private javax.swing.JRadioButton RBtnTipoCta_Cte;
private javax.swing.JTextField TxtCedula;
private javax.swing.JTextField TxtDireccion;
private javax.swing.JTextField TxtEstado;
private javax.swing.JTextField TxtEstado_Aho;
private javax.swing.JTextField TxtEstado_Cte;
private javax.swing.JTextField TxtMonto_Aho;
private javax.swing.JTextField TxtMonto_Cte;
private javax.swing.JTextField TxtNombre;
private javax.swing.JTextField TxtNumCta_Aho;
private javax.swing.JTextField TxtNumCta_Cte;
private javax.swing.JTextField TxtValor;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel9;

18

private javax.swing.JSeparator jSeparator1;


private javax.swing.JSeparator jSeparator2;
// End of variables declaration
}

19

Você também pode gostar