public void payFine() {
		
		// User inputs: bid, fid, amount to pay
				JTextField bidField = new JTextField(15);
				JTextField fineField = new JTextField(15);
				JTextField amountField = new JTextField(15);

				JComponent[] inputs = new JComponent[] { 
						new JLabel("Borrowing ID:"), bidField,
						new JLabel("Fine ID:"), fineField,
						new JLabel("Amount:"), amountField,

				};
				int result = JOptionPane.showConfirmDialog(null, inputs,
						"Enter fine info", JOptionPane.OK_CANCEL_OPTION,
						JOptionPane.WARNING_MESSAGE);

				if (result == JOptionPane.OK_OPTION) {
					int bid = Integer.parseInt(bidField.getText());
					int fid = Integer.parseInt(fineField.getText());
					float amount = Float.parseFloat(amountField.getText());
					
					java.util.Date currentDate = new java.util.Date();
					DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
					Date paidDate = null;
					try {
						paidDate = new Date(dateFormat.parse(dateFormat.format(currentDate)).getTime());
					} catch (ParseException e1) {
						// TODO Auto-generated catch block
						e1.printStackTrace();
					}
					try {
						PreparedStatement ps = Library.con
								.prepareStatement("SELECT * FROM fine WHERE borid = ? and fid = ?");
						ps.setInt(1, bid);
						ps.setInt(2, fid);
						ps.executeQuery();

						ResultSet rs = ps.getResultSet();
						if(rs.next() == true) {
							// get fine amount for borrower
							float due = rs.getFloat("amount");
							float remainingFine = due - amount;
							
							if (remainingFine < 0.0f) {
								remainingFine = 0.00f;
							}

							PreparedStatement ps2 = Library.con
									.prepareStatement("UPDATE Fine Set amount = ?, paidDate = ? WHERE fid = ?");
							ps2.setFloat(1, remainingFine);
							ps2.setDate(2, paidDate);
							ps2.setInt(3, fid);

							ps2.executeUpdate();
							Library.con.commit();
							
							String msg = String.format("<html>Remaining balance for fine ID %d is $%.2f.", fid, remainingFine);
							msg += "<br>";
							msg += "Thank you.</html>";
							new ErrorMessage(msg);
							
							ps2.close();
						}


						// Show tables
						Statement stmt = Library.con.createStatement();
						ResultSet rs2 = stmt.executeQuery("SELECT * FROM Fine");
						LibraryGUI.showTable(rs2, "payFineButton");
						
						ps.close();
						

					} catch (SQLException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
	}