public void transfer() {
 		String number = currentAccountNumber();
		if (number != null) {
			try{
				Set<String> s = new HashSet<String>(accounts.keySet());
				s.remove(number);

			    TransferDialog trans = new TransferDialog(this, "Transfer Money", number, s);
				Point loc = getLocation();
				trans.setLocation(loc.x + 50, loc.y + 50);
				trans.setModal(true);
		    	trans.setVisible(true);

		    	if (!trans.canceled()) {
			    	if (number.equals(trans.getAccountNumber())){
			    		JOptionPane.showMessageDialog(this, "Both Accounts are the same!",
							"Error", JOptionPane.ERROR_MESSAGE);
			    	}
			    	else {
						try {
							double amount = Double.parseDouble(trans.getBalance());
							Account from = accounts.get(number);
							Account to   = accounts.get(trans.getAccountNumber());
							bank.transfer(from, to, amount);
							
							// after transfer adjust value of displayed account
							fld_balance.setText(currencyFormat(from.getBalance()));

				    	    JOptionPane.showMessageDialog(this,"Transfer successfull",
								"Information", JOptionPane.INFORMATION_MESSAGE);
				    	}
				    	catch (NumberFormatException e) {
				    		JOptionPane.showMessageDialog(this,"Illegal Balance",
								"Error", JOptionPane.ERROR_MESSAGE);
				    	}
						catch (IllegalArgumentException e) {
							JOptionPane.showMessageDialog(this, "Illegal Argument",
								"Error", JOptionPane.ERROR_MESSAGE);
						}
						catch (InactiveException e) {
							JOptionPane.showMessageDialog(this, "At least one account is inactive",
								"Error", JOptionPane.ERROR_MESSAGE);
						}
						catch (OverdrawException e) {
							JOptionPane.showMessageDialog(this, "Account must not be overdrawn",
								"Error", JOptionPane.ERROR_MESSAGE);
						}
			    	}
		    	}
			}
			catch(Exception e){
				error(e);
			}
		}
    }