*/
    private void button_pSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_pSaveActionPerformed
        //need to build the array of components for checkRegister_()
        JComponent[] toCheck = {textfield_pKontoname, password_pPass1, password_pPass2, textfield_pEmail1, textfield_pEmail2, textfield_pName, textfield_pSurename};
        JLabel[] errMess = {label_pErrAccname, label_pErrPass1, label_pErrPass2, label_pErrEmail1, label_pErrEmail2, label_pErrFirstName, label_pErrLastName};
        //need to build the array of components for checkGlobUserVar()
        JTextField[] toCheck2 = {textfield_pKontoname, textfield_pEmail1};
        JLabel[] errMess2 = {label_pErrAccname, label_pErrEmail1};
        //Let's build the "enter password"-message
        JLabel inputLabel = new JLabel("Bitte aktuelles Passwort eingeben!");
        JPasswordField inputPw = new JPasswordField();
        Object[] ob = {inputLabel, inputPw};
        //needed for usability
        Boolean okPressed = false;
        Boolean changePass = false;

        if (((_mainuser.getAccountname().equals(textfield_pKontoname.getText()) & _mainuser.getEmail().equals(textfield_pEmail1.getText())) | !checkGlobUserVar(toCheck2, errMess2)) & checkRegister_(toCheck, errMess)) {
            if (JOptionPane.showConfirmDialog(null, ob, "", JOptionPane.YES_OPTION) == JOptionPane.YES_OPTION) {
                if (new String(inputPw.getPassword()).equals(_mainuser.getPassword())) {
                    //if everything went right the first time, save the changes
                    changePass = true;
                } else {
                    //if the password was wrong tell it to the user
                    inputLabel.setText("Falsches Passwort! Bitte aktuelles Passwort eingeben!");
                    inputPw.setText("");
                    while ((okPressed = (JOptionPane.showConfirmDialog(null, ob, "", JOptionPane.YES_OPTION) == JOptionPane.YES_OPTION)) & !new String(inputPw.getPassword()).equals(_mainuser.getPassword())) {
                        //just repeat if the user keeps hitting "yes" with the wrong password put in
                        inputPw.setText("");
                    }
                    //If the user entered the correct password save the changes
                    if (okPressed & new String(inputPw.getPassword()).equals(_mainuser.getPassword())) {
                        changePass = true;
                    }
                }
            }
            if (changePass) {
                //changes are saved
                if (!_mainuser.getAccountname().equals(textfield_pKontoname.getText()) | !_mainuser.getEmail().equals(textfield_pEmail1.getText())) {
                    User.deleteUser(_mainuser);
                }
                User.createUser(textfield_pKontoname.getText(), password_pPass1.getPassword(), textfield_pEmail1.getText(), textfield_pName.getText(), textfield_pSurename.getText(), _mainuser.getReg_date(), _mainuser.getLast_login(), _mainuser.getTime_played(), _mainuser.getUcoins());
                _mainuser = new User(textfield_pKontoname.getText());
            }
            //close the profile panel and tell the user he was successfull
            panel_Profile.setVisible(false);
            JOptionPane.showMessageDialog(null, "Daten erfolgreich geändert!");
        }
    }