Mostra operazioni

This commit is contained in:
La Programmatrice Verde
2026-03-03 11:37:42 +01:00
parent 5504dfd91c
commit d6f140dae7
11 changed files with 47 additions and 49 deletions

View File

@@ -5,6 +5,7 @@
package gui;
import java.awt.Color;
import java.io.IOException;
import java.text.ParseException;
import java.util.Date;
import java.util.regex.Pattern;
@@ -264,8 +265,12 @@ public class GUIMyBank extends javax.swing.JFrame {
}// </editor-fold>//GEN-END:initComponents
private void btnListaMovimentiActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnListaMovimentiActionPerformed
txtaListaMovimenti.setText(contoCorrente.getLogOperazioni());
txtaListaMovimenti.setVisible(true);
try {
txtaListaMovimenti.setText(contoCorrenteAperto.getLog());
txtaListaMovimenti.setVisible(true);
} catch (IOException e) {
JOptionPane.showMessageDialog(null, e.getMessage());
}
}// GEN-LAST:event_btnListaMovimentiActionPerformed
private void txtNomeFocusGained(java.awt.event.FocusEvent evt) {// GEN-FIRST:event_txtNomeFocusGained
@@ -303,6 +308,8 @@ public class GUIMyBank extends javax.swing.JFrame {
} catch (NumberFormatException _) {
JOptionPane.showMessageDialog(null, "L'importo che si desidera versare non è valido.");
error = true;
} catch (IOException e) {
JOptionPane.showMessageDialog(null, e.getMessage());
}
} while (error);
}// GEN-LAST:event_btnVersamentoActionPerformed
@@ -325,6 +332,8 @@ public class GUIMyBank extends javax.swing.JFrame {
} catch (IllegalArgumentException e) {
JOptionPane.showMessageDialog(null, e.getMessage());
error = true;
} catch (IOException e) {
JOptionPane.showMessageDialog(null, e.getMessage());
}
} while (error);
}// GEN-LAST:event_btnPrelievoActionPerformed
@@ -385,21 +394,25 @@ public class GUIMyBank extends javax.swing.JFrame {
return;
}
this.contoCorrenteAperto = MyBank.aggiungiConto(nome, cognome, codiceFiscale, dataDiNascita, saldoIniziale);
txtNumeroContoCorrente.setText(Integer.toString(MyBank.getConti().getLast().getNumeroContoCorrente()));
try {
this.contoCorrenteAperto = MyBank.aggiungiConto(nome, cognome, codiceFiscale, dataDiNascita, saldoIniziale);
txtNumeroContoCorrente.setText(Integer.toString(MyBank.getConti().getLast().getNumeroContoCorrente()));
lblNumeroContoCorrente.setVisible(true);
txtNumeroContoCorrente.setVisible(true);
btnVersamento.setVisible(true);
btnPrelievo.setVisible(true);
btnListaMovimenti.setVisible(true);
txtNome.setEditable(false);
txtCognome.setEditable(false);
txtCodiceFiscale.setEditable(false);
txtDataDiNascita.setEditable(false);
txtSaldoIniziale.setEditable(false);
btnAprireContoCorrente.setEnabled(false);
btnDataDiNascita.setEnabled(false);
lblNumeroContoCorrente.setVisible(true);
txtNumeroContoCorrente.setVisible(true);
btnVersamento.setVisible(true);
btnPrelievo.setVisible(true);
btnListaMovimenti.setVisible(true);
txtNome.setEditable(false);
txtCognome.setEditable(false);
txtCodiceFiscale.setEditable(false);
txtDataDiNascita.setEditable(false);
txtSaldoIniziale.setEditable(false);
btnAprireContoCorrente.setEnabled(false);
btnDataDiNascita.setEnabled(false);
} catch (IOException e) {
JOptionPane.showMessageDialog(null, e.getMessage());
}
}// GEN-LAST:event_btnAprireContoCorrenteActionPerformed