private boolean processFields() {

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

        type = categoryTypeModel.getTypeAt(type);
        
        String name = categoryName.getText();
        if (name.length() == 0) {
            JOptionPane.showMessageDialog(this, "You must specify a category name",
                                          "Error", JOptionPane.ERROR_MESSAGE);
            return false;
        }
        
        for (CategoryRecord c : CategoryRecord.categories) {
            if (name.equals(c.getName()) && c != category) {
                JOptionPane.showMessageDialog(this, "Category name '"+name+"' is already in use",
                                              "Error", JOptionPane.ERROR_MESSAGE);
                return false;
            }
        }
        
        //
        // Create a new category or update an existing category
        //
        if (category == null) {
            category = new CategoryRecord(name, type);
            category.setHide(categoryHidden.isSelected());
            if (CategoryRecord.categories.contains(category)) {
                JOptionPane.showMessageDialog(this, "Category '"+name+"' already exists",
                                              "Error", JOptionPane.ERROR_MESSAGE);
                return false;
            }

            CategoryRecord.categories.add(category);
            listModel.addDBElement(category);
        } else {
            if (!category.getName().equals(name)) {
                CategoryRecord.categories.remove(category);
                category.setName(name);
                CategoryRecord.categories.add(category);
            }
            
            category.setType(type);
            category.setHide(categoryHidden.isSelected());
            listModel.updateDBElement();
        }

        Main.dataModified = true;
        return true;
    }