/** * Adds a change listener to the specified component. * * @param comp the component to add the listener to */ protected void addChangeListenerTo(Component comp) { if (comp instanceof AbstractChooserPanel) ((AbstractChooserPanel) comp).addChangeListener(this); else if (comp instanceof JTextComponent) ((JTextComponent) comp).getDocument().addDocumentListener(m_DocumentListener); else if (comp instanceof AbstractButton) ((AbstractButton) comp).addActionListener(m_ActionListener); else if (comp instanceof JComboBox) ((JComboBox) comp).addActionListener(m_ActionListener); else if (comp instanceof JSpinner) ((JSpinner) comp).addChangeListener(this); else if (comp instanceof PropertyEditor) ((PropertyEditor) comp).addPropertyChangeListener(m_PropertyChangeListener); //else // System.err.println("Failed to add change listener to component type: " + Utils.classToString(comp)); }