private boolean processFields() {
        boolean newSecurity;

        //
        // Validate the security information
        //
        int type = securityType.getSelectedIndex();
        if (type < 0) {
            JOptionPane.showMessageDialog(this, "You must select a security type",
                                          "Error", JOptionPane.ERROR_MESSAGE);
            return false;
        }

        type = securityTypeModel.getTypeAt(type);
        
        String name = securityName.getText();
        if (name.length() == 0) {
            JOptionPane.showMessageDialog(this, "You must specify a security name",
                                          "Error", JOptionPane.ERROR_MESSAGE);
            return false;
        }
        
        for (SecurityRecord s : SecurityRecord.securities) {
            if (name.equals(s.getName()) && s != security) {
                JOptionPane.showMessageDialog(this, "Security name '"+name+"' is already in use",
                                              "Error", JOptionPane.ERROR_MESSAGE);
                return false;
            }
        }

        String symbol = tickerSymbol.getText().toUpperCase();
        int paymentType = incomePaymentModel.getTypeAt(incomePayment.getSelectedIndex());
        boolean hidden = securityHidden.isSelected();

        //
        // Create a new security or update an existing security
        //
        if (security == null) {
            newSecurity = true;
            security = new SecurityRecord(name, type);
            if (SecurityRecord.securities.contains(security)) {
                JOptionPane.showMessageDialog(this, "Security '"+name+"' already exists",
                                              "Error", JOptionPane.ERROR_MESSAGE);
                return false;
            }
            
            SecurityRecord.securities.add(security);
        } else {
            newSecurity = false;
            security.setType(type);
            if (!security.getName().equals(name)) {
                SecurityRecord.securities.remove(security);
                security.setName(name);
                SecurityRecord.securities.add(security);
            }
        }

        security.setSymbol(symbol);
        security.setPaymentType(paymentType);
        security.setHide(hidden);
        
        if (newSecurity)
            listModel.addDBElement(security);
        else
            listModel.updateDBElement();

        Main.dataModified = true;
        return true;
    }