private void updateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateButtonActionPerformed
        // Error handling to ensure that arrival is before departure, and one of the fields aren't empty.
        if ("".equals(jXDatePickerChangeArrival.getEditor().getText()) || "".equals(jXDatePickerChangeDeparture.getEditor().getText())) {
            JOptionPane.showMessageDialog(rootPane, "Make sure both arrival and departure date are entered and in the correct format");
        } else {
            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
            Date date = new Date();
            jXDatePickerChangeArrival.setFormats(dateFormat);
            jXDatePickerChangeDeparture.setFormats(dateFormat);
            String arrival = dateFormat.format(jXDatePickerChangeArrival.getDate()).toString();
            String departure = dateFormat.format(jXDatePickerChangeDeparture.getDate()).toString();
            int numberOfGuests = Integer.parseInt(noOfGuestsEditField.getText());
            int paid = 0;
            if (jCheckBoxPaidBooking.isSelected() == true) {
                paid = 1;
            }
            //If statements to control that inputs are valid
            if (Integer.parseInt(noOfGuestsEditField.getText()) <= 5 && Integer.parseInt(noOfGuestsEditField.getText()) > 0) {
                if (jXDatePickerChangeArrival.getDate().after(date)) {
                    if (jXDatePickerChangeDeparture.getDate().after(jXDatePickerChangeArrival.getDate())) {
                        bo = con.changeBookingInformation(arrival, departure, numberOfGuests, paid);
                        boolean status = con.saveBooking();
                        if (status) {
                            jLabelStatusBooking.setText("Booking updated!");
                        } else {
                            jLabelStatusBooking.setText("Booking could not be updated!");
                        }
                        con.resetBooking();
                    } else {
                        JOptionPane.showMessageDialog(rootPane, "Make sure arrival date is before departure date");
                        Statuslabel.setText("Booking not updated!");
                    }
                } else {
                    JOptionPane.showMessageDialog(rootPane, "Make sure arrival date is after todays date");
                    Statuslabel.setText("Booking not updated!");
                }
            } else {
                JOptionPane.showMessageDialog(rootPane, "Invalid number of guests - check your input");
                Statuslabel.setText("Booking not updated!");
            }
            //Clears the jListBooking
            DefaultListModel model = new DefaultListModel();
            jListBooking.setModel(model);
            model.clear();
        }
        //Reset the current transaction
        con.resetBooking();
    }//GEN-LAST:event_updateButtonActionPerformed