public int addFromFile(Entry newEntry, int duplicate) {   //1 means add duplicates, 0 means don't, -1 means we don't know yet
		boolean found = false;		//file not already in user's library
		if (duplicate == 0 || duplicate == -1) {	//we don't/don't know about adding duplicates
			for (int i = 0; i < library.size(); i++) {
				if (library.get(i).equals(newEntry)) {
					found = true;	//we found the file
					if (duplicate == -1) {	//if we don't know about adding duplicates yet
						int a = JOptionPane.showConfirmDialog(null, "This input file contains plant files that already exist in the library. Do you want to add the duplicate files?","Duplicate Plants",JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE);
						if (a == 0) { //yes add
							duplicate = 1;	//add the duplicate
						}
						if (a == 1) { //no don't add
							duplicate = 0;
						}
					}
					break;
				}
			}
		}
		if (duplicate == 1 || !found) { //if we add duplicates or if we didn't find the file in the library already, add it
			newEntry.setKey(counter);
			counter++;
			library.add(newEntry);
		}
		return duplicate;	//if duplicate is now 1 or 0, its value will not be changed again for the given text file
	}//end addFromFile