private void transfer() {
        String amountStr = JOptionPane.showInputDialog(this, "Input an amount to transfer:", "Transfer", JOptionPane.QUESTION_MESSAGE);
        if (amountStr == null) {
            return;
        }
        try {
            BigDecimal amount = FORMATTER.stringToValue(amountStr);
            Set<Account> accounts = new HashSet<Account>(controller.getCurrentUser().getAccounts());
            Iterator<Account> iterator = accounts.iterator();
            while (iterator.hasNext()) {
                Account account = iterator.next();
                if (account.getType().isLoan() && account.getBalance().negate().compareTo(amount) < 0) {
                    iterator.remove();
                }
            }
            if (!accounts.isEmpty()) {
                Account account = (Account) JOptionPane.showInputDialog(this, "Choose an account:", "Transfer",
                        JOptionPane.QUESTION_MESSAGE, null, accounts.toArray(), accounts.iterator().next());
                if (account != null) {
                    this.account.withdraw(amount);
                    account.deposit(amount);
                    controller.updateBankDisplay();
                }
            } else {
                JOptionPane.showMessageDialog(this, "No accounts can accept that balance.", "Transfer failed", JOptionPane.ERROR_MESSAGE);
                return;
            }
        } catch (ParseException px) {
            controller.handleException(this, px);
        } catch (InvalidInputException iix) {
            controller.handleException(this, iix);
        } catch (InsufficientFundsException ifx) {
            controller.handleException(this, ifx);
        }
    }