public void newPreference() {
		JPanel form = createPreferenceForm();
		int selectedValue = JOptionPane.showConfirmDialog(this, form,
				"New Preference", JOptionPane.YES_NO_OPTION,
				JOptionPane.PLAIN_MESSAGE);
		if (selectedValue == JOptionPane.YES_OPTION) {
			String key = null;
			String value = null;
			// get the entered values
			for (Component c : form.getComponents()) {
				String name = c.getName();
				if (name != null && name.equals("key")) {
					key = ((JTextField) c).getText();
				}
				if (name != null && name.equals("value")) {
					value = ((JTextField) c).getText();
				}
			}
			if (value == null) {
				value = "";
			}
			// the key cannot be empty, but the value can
			if (key != null && !key.equals("")) {
				addRow(key, value);
				System.out.println("added [" + key + ", " + value + "]");
			}
		}
	}