/** * Removes a change listener from the specified component. * * @param comp the component to remove the listener from */ protected void removeChangeListenerFrom(Component comp) { if (comp instanceof AbstractChooserPanel) ((AbstractChooserPanel) comp).removeChangeListener(this); else if (comp instanceof JTextComponent) ((JTextComponent) comp).getDocument().removeDocumentListener(m_DocumentListener); else if (comp instanceof AbstractButton) ((AbstractButton) comp).removeActionListener(m_ActionListener); else if (comp instanceof JComboBox) ((JComboBox) comp).removeActionListener(m_ActionListener); else if (comp instanceof JSpinner) ((JSpinner) comp).removeChangeListener(this); else if (comp instanceof PropertyEditor) ((PropertyEditor) comp).removePropertyChangeListener(m_PropertyChangeListener); //else // System.err.println("Failed to remove change listener from component type: " + Utils.classToString(comp)); } }