private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        int isbn=Integer.parseInt(jTextField9.getText());
        String title=jTextField10.getText();
        int num=Integer.parseInt(jTextField23.getText());
                         
        ArrayList<String> fName=new ArrayList<String>();
        fName.add(jTextField11.getText()); 
        ArrayList<String> lName=new ArrayList<String>();
        lName.add(jTextField12.getText());
        ArrayList<Long> phone=new ArrayList<Long>();
        phone.add(Long.parseLong(jTextField13.getText()));
        ArrayList<String> street=new ArrayList<String>();
        street.add(jTextField14.getText());
        ArrayList<String> city=new ArrayList<String>();
        city.add(jTextField15.getText());
        ArrayList<String> state=new ArrayList<String>();
        state.add(jTextField16.getText());
        ArrayList<Integer> zip=new ArrayList<Integer>();
        zip.add(Integer.parseInt(jTextField17.getText()));
                
        if(jTextField18.getText().length()>0){            
            String names[]=jTextField18.getText().split(",");
            String phones[]=jTextField19.getText().split(",");
            String adds[]=jTextArea2.getText().split(";");
            for(int it=0;it<names.length;it++){
                fName.add(names[it].split(" ")[0]);
                lName.add(names[it].split(" ")[1]);
                phone.add(Long.parseLong(phones[it]));
                String adLine[]=adds[it].split(",");
                street.add(adLine[0]);
                city.add(adLine[1]);
                state.add(adLine[2]);
                zip.add(Integer.parseInt(adLine[3]));
            }
        }
        
        String authorsThis="";
        List<Author> thisBookAuth=new ArrayList<Author>();
        for(int p=0;p<fName.size();p++){
            Author a=new Author(fName.get(p), lName.get(p), phone.get(p),jTextField24.getText(),jTextField25.getText()+" scholar");
            String sep=(p==fName.size()-1)?"":",";
            authorsThis+=(fName.get(p)+" "+lName.get(p)+sep);
            a.setAddress(new Address(street.get(p), city.get(p), state.get(p), zip.get(p)));            
            thisBookAuth.add(a);
            // add to file
            try(PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("src/data/authors.txt", true)))) {
                out.println(fName.get(p)+";"+ lName.get(p)+";"+ phone.get(p)+";"+street.get(p)+";"+ city.get(p)+";"+ state.get(p)+";"+ zip.get(p)+";"+jTextField24.getText()+";"+jTextField25.getText()+" scholar");
            }catch (IOException e) {
                 System.out.println("Data not written to file!");
            }
        }
        
        auths.addAll(thisBookAuth);
        
        Book newBok=new Book(title, isbn);        
        newBok.setAuthors(thisBookAuth);        
        books.add(newBok);        
        
        // add to file
        try(PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("src/data/books.txt", true)))) {
            out.println(title+";"+isbn+";"+authorsThis);
        }catch (IOException e) {
             System.out.println("Data not written to file!");
        }
        
        for(int k=0;k<num;k++){
            try(PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("src/data/copies.txt", true)))) {
                copies.add(new Copy(k, (Publication)newBok));
                out.println(k+";"+title+";available");
            }catch (IOException e) {
             System.out.println("Data not written to file!");
            }
        }
        dummy=title;
    }//GEN-LAST:event_jButton2ActionPerformed