Pulsante cancella
This commit is contained in:
@@ -268,6 +268,9 @@
|
|||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Cancella"/>
|
<Property name="text" type="java.lang.String" value="Cancella"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancellaActionPerformed"/>
|
||||||
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="btnChiudi">
|
<Component class="javax.swing.JButton" name="btnChiudi">
|
||||||
<Properties>
|
<Properties>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class RegistrazionePalestra extends javax.swing.JFrame {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated
|
// <editor-fold defaultstate="collapsed" desc="Generated
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated
|
// <editor-fold defaultstate="collapsed" desc="Generated
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated
|
||||||
// Code">//GEN-BEGIN:initComponents
|
// Code">//GEN-BEGIN:initComponents
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
|
||||||
@@ -137,6 +138,7 @@ public class RegistrazionePalestra extends javax.swing.JFrame {
|
|||||||
btnRegistra.addActionListener(this::btnRegistraActionPerformed);
|
btnRegistra.addActionListener(this::btnRegistraActionPerformed);
|
||||||
|
|
||||||
btnCancella.setText("Cancella");
|
btnCancella.setText("Cancella");
|
||||||
|
btnCancella.addActionListener(this::btnCancellaActionPerformed);
|
||||||
|
|
||||||
btnChiudi.setText("Chiudi");
|
btnChiudi.setText("Chiudi");
|
||||||
|
|
||||||
@@ -341,6 +343,25 @@ public class RegistrazionePalestra extends javax.swing.JFrame {
|
|||||||
pack();
|
pack();
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void btnCancellaActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnCancellaActionPerformed
|
||||||
|
txtNome.setText("");
|
||||||
|
txtCognome.setText("");
|
||||||
|
txtCodiceFiscale.setText("");
|
||||||
|
txtEmail.setText("");
|
||||||
|
txtPassword.setText("");
|
||||||
|
|
||||||
|
Sesso.clearSelection();
|
||||||
|
|
||||||
|
chkYoga.setSelected(false);
|
||||||
|
chkPilates.setSelected(false);
|
||||||
|
chkFitness.setSelected(false);
|
||||||
|
|
||||||
|
cmbCitta.setSelectedItem(cmbCitta.getItemAt(0));
|
||||||
|
|
||||||
|
txtaNote.setText("");
|
||||||
|
|
||||||
|
}// GEN-LAST:event_btnCancellaActionPerformed
|
||||||
|
|
||||||
private void txtCodiceFiscaleKeyReleased(java.awt.event.KeyEvent evt) {// GEN-FIRST:event_txtCodiceFiscaleKeyReleased
|
private void txtCodiceFiscaleKeyReleased(java.awt.event.KeyEvent evt) {// GEN-FIRST:event_txtCodiceFiscaleKeyReleased
|
||||||
txtCodiceFiscale.setText(txtCodiceFiscale.getText().toUpperCase());
|
txtCodiceFiscale.setText(txtCodiceFiscale.getText().toUpperCase());
|
||||||
}// GEN-LAST:event_txtCodiceFiscaleKeyReleased
|
}// GEN-LAST:event_txtCodiceFiscaleKeyReleased
|
||||||
@@ -497,7 +518,8 @@ public class RegistrazionePalestra extends javax.swing.JFrame {
|
|||||||
sb.append(note);
|
sb.append(note);
|
||||||
sb.append("\n--FINE REGISTRAZIONE SOPRA--");
|
sb.append("\n--FINE REGISTRAZIONE SOPRA--");
|
||||||
|
|
||||||
try (BufferedWriter bw = new BufferedWriter(new FileWriter("./src/registrazionepalestra/registrazioni.txt", true))) {
|
try (BufferedWriter bw = new BufferedWriter(
|
||||||
|
new FileWriter("./src/registrazionepalestra/registrazioni.txt", true))) {
|
||||||
bw.write(sb.toString());
|
bw.write(sb.toString());
|
||||||
} catch (IOException _) {
|
} catch (IOException _) {
|
||||||
JOptionPane.showMessageDialog(null, "Errore nel salvataggio della registrazione.");
|
JOptionPane.showMessageDialog(null, "Errore nel salvataggio della registrazione.");
|
||||||
|
|||||||
Reference in New Issue
Block a user