private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
        // Pick Up
        
        boolean resPicked=false;
                
        for(Reservation r:reservations){
            if(r.getMember().getFirstName().trim().equals(jTextField32.getText().trim().split(" ")[0].trim()) &&
                    r.getMember().getLastName().trim().equals(jTextField32.getText().trim().split(" ")[1].trim()) &&                    
                        r.getPublication().getTitle().trim().equals(jTextField33.getText().trim()) &&
                            r.getStatus().trim().equals("hold")){                
                
                Member m=r.getMember();
                Copy sc=r.getCopy();
                Loan lMade=m.pickupReservation(r);
                
                 if(lMade!=null){
                    loans.add(lMade);
                    m.addLoan(lMade);                    
                    sc.addLoan(lMade);                    
                    try(PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("src/data/loans.txt", true)))) {                
                        out.println(lMade.getBorrower().getMemberNo()+";"+sc.getCopyNo()+","+r.getPublication().getTitle()+";"
                                    + new SimpleDateFormat("yyyy/MM/dd").format(lMade.getCheckoutDate().getTime()) +";"
                                        + new SimpleDateFormat("yyyy/MM/dd").format(lMade.getReturnDate().getTime()));
                    }catch (IOException e) {
                     System.out.println("Data not written to file!");
                    }
                    
                    
                    // Don't edit code below as it edits db file
                    UpdateCopies("", r.getCopy());
                    
                }  
                                                
                resPicked=true;               
            }
        }
        
        if(resPicked){
            jLabel42.setText("Reservation picked!");
        }
        else{
            jLabel42.setText("Reservation could not be picked!");
        }
    }//GEN-LAST:event_jButton9ActionPerformed