private void bookRoomButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bookRoomButtonActionPerformed
        if (roomTable.getSelectedRow() > -1) {
            Room chosenRoom = null;
            int selectedRowIndex = roomTable.getSelectedRow();
            int roomNo = (Integer) roomTableModel.getValueAt(selectedRowIndex, 0);
            ArrayList<Room> roomList;
            roomList = ctr.getRooms();

            for (Room room : roomList) {
                if (room.getRoomNo() == roomNo) {
                    chosenRoom = room;
                }
            }
            if (chosenRoom != null && guestJList.getSelectedValue() != null) {
                Booking newBooking = null;
                Guest guest = (Guest) guestJList.getSelectedValue(); ////typecast til guest-objekt
                newBooking = ctr.createBooking(chosenRoom, guest, checkIn.getDate(), checkOut.getDate());
                if (newBooking != null) {
                    newBookingModel.addElement(newBooking);
                    newBookingJList.setModel(newBookingModel);
                    newBookingStatusLabel.setText("Room booked by " + guest.getFirstName() + " " + guest.getLastName());
                    roomTableModel.removeRow(selectedRowIndex);
                }
                else {
                    jOptionPane.showMessageDialog(this, "Room is already booked for that period!", "Doublebooking", jOptionPane.INFORMATION_MESSAGE);
                }
            }
            else {
                jOptionPane.showMessageDialog(this, "You must select a room and a guest!");
            }
        }
    }//GEN-LAST:event_bookRoomButtonActionPerformed