private void addAccount() {
        String name = nameField.getText().trim();
        try {
            Account account = new Account(name.trim());
            account.setType((AccountType) type.getSelectedItem());
            String text = defaultAmountField.getText();
            if (text != null && !text.trim().equals("")) {
                try {
                    BigDecimal defaultAmount = new BigDecimal(text);
                    defaultAmount = defaultAmount.setScale(2);
                    account.setDefaultAmount(defaultAmount);
                } catch (NumberFormatException nfe) {
                    account.setDefaultAmount(null);
                }
            }
            accounts.addBusinessObject(account);
            Main.fireAccountDataChanged(account);
        } catch (DuplicateNameException e) {
            ActionUtils.showErrorMessage(ActionUtils.ACCOUNT_DUPLICATE_NAME, name);
        } catch (EmptyNameException e) {
            ActionUtils.showErrorMessage(ActionUtils.ACCOUNT_NAME_EMPTY);
        }
        nameField.setText("");
        defaultAmountField.setText("");
    }