{ String s = e.getActionCommand(); int index = Integer.parseInt(s); try { switch (index) { case FAMILY: JComboBox cbx = (JComboBox) e.getSource(); setFamily(cbx.getSelectedIndex()); break; case WAVELENGTH: JComboBox cbx1 = (JComboBox) e.getSource(); setWavelength(cbx1.getSelectedIndex()); break; case HISTOGRAM: popUpHistogram(); } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } }
{ String s = e.getActionCommand(); int index = Integer.parseInt(s); try { switch (index) { case FAMILY: JComboBox cbx = (JComboBox) e.getSource(); setFamily(cbx.getSelectedIndex()); break; case WAVELENGTH: JComboBox cbx1 = (JComboBox) e.getSource(); setWavelength(cbx1.getSelectedIndex()); break; case HISTOGRAM: popUpHistogram(); break; case NOISE: JCheckBox box = (JCheckBox) e.getSource(); setNoiseReduction(box.isSelected()); } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } }
	public void actionPerformed(ActionEvent e)	{		String s = e.getActionCommand();		int index = Integer.parseInt(s);		try {			switch (index) { 				case FAMILY:					JComboBox cbx = (JComboBox) e.getSource();					setFamily(cbx.getSelectedIndex());					break;				case WAVELENGTH:					JComboBox cbx1 = (JComboBox) e.getSource();					setWavelength(cbx1.getSelectedIndex());					break;				case HISTOGRAM:					popUpHistogram();			}		} catch(NumberFormatException nfe) {  			throw new Error("Invalid Action ID "+index, nfe);		} 	}