public void actionPerformed(ActionEvent e) {
		
		Object o = e.getSource();
		
		Debug.print("Action performed on: " + o);
		if(o == okButton) {
			
			
			// create a new Ferm object
			Fermentable i = new Fermentable();
			i.setName(txtName.getText());
			try {
				NumberFormat format = NumberFormat.getInstance(Locale.getDefault());
				Number number = format.parse(txtYield.getText().trim());
				i.setPppg(number.doubleValue());
			} catch (ParseException  m) {
				Debug.print("Could not read txtYield as double");
			}
			
			try {
				NumberFormat format = NumberFormat.getInstance(Locale.getDefault());
				Number number = format.parse(txtLov.getText().trim());
				i.setLov(number.doubleValue());
			} catch (ParseException  m) {
				Debug.print("Could not read txtLov as double");
			}	
			i.setCost(txtCost.getText());
			
			try {
				NumberFormat format = NumberFormat.getInstance(Locale.getDefault());
				Number number = format.parse(txtStock.getText().trim());
				i.setStock(number.doubleValue());
			} catch (ParseException  m) {
				Debug.print("Could not read txtStock as double");
			}
			
			i.setUnits(cUnits.getSelectedItem().toString());
			i.setMashed(bMash.isSelected());
			i.setDescription(txtDescr.getText());
			i.setModified(bModified.isSelected());
			i.setSteep(bSteep.isSelected());
			i.ferments(bFerments.isSelected());
			
			int result = 1;
			int found = 0;
			
			// check to see if we have this fermentable already in the db
			if((found = db.find(i)) >= 0){
				// This already exists, do we want to overwrite?
				result = JOptionPane.showConfirmDialog((Component) null, 
							"This ingredient exists, overwrite original?","alert", JOptionPane.YES_NO_CANCEL_OPTION);
				switch(result) {
				case JOptionPane.NO_OPTION:
					setVisible(false);
					dispose();
					return;
					
				case JOptionPane.YES_OPTION:
					db.fermDB.remove(found);
					break;
				
				case JOptionPane.CANCEL_OPTION:
					return;
				}
			}
			
			
			
			db.fermDB.add(i);
			db.writeFermentables();

			setVisible(false);
			dispose();
			
		} else if(o == cancelButton) {
			dispose();
		}
		
	}