All pastes #455907 Raw Edit

addBorrower method

public java v1 · immutable
#455907 ·published 2007-04-24 15:10 UTC
rendered paste body
public void addBorrower()    {        String borrowerEntry = borrowerField.getText();        try         {        int borrowerEntryInted = Integer.valueOf(borrowerEntry).intValue();        }        catch (NumberFormatException e)        {            JOptionPane.showMessageDialog(errorPane, "Please enter a whole number into the borrower field");            return;        }        if (lastBookCount == 0)        {            JOptionPane.showMessageDialog(errorPane, "The last search generated no books");        }        else if (lastBookCount > 1)        {            JOptionPane.showMessageDialog(errorPane, "The last search generated more than one book");        }        else if (borrowerEntry.length() == 0)        {            JOptionPane.showMessageDialog(errorPane, "The borrower text field is empty, please add a borrower id");        }    }