private void jButtonCheckRoomsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCheckRoomsActionPerformed
        //Removes all the current elements listed in the jList.
        dflRooms.removeAllElements();
        //Error handling which makes sure that the arrival date is before the departure date and they're not empty.
        if ("".equals(jXDatePickercheckRoomArrival.getEditor().getText()) || "".equals(jXDatePickercheckRoomDeparture.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");
            jXDatePickercheckRoomArrival.setFormats(dateFormat);
            jXDatePickercheckRoomDeparture.setFormats(dateFormat);
            String arrival = dateFormat.format(jXDatePickercheckRoomArrival.getDate()).toString();
            String departure = dateFormat.format(jXDatePickercheckRoomDeparture.getDate()).toString();
            r = con.getRoomsList(arrival, departure);
            if (r != null) {
                for (int i = 0; i < r.size(); i++) {
                    dflRooms.addElement(r.get(i).toString());
                }
            } else {
                Statuslabel.setText("Could not get Rooms");
            }
            //Resets the current session.
            con.resetRooms();
        }
    }//GEN-LAST:event_jButtonCheckRoomsActionPerformed