code: protected JTextComponent getTextComponent( JComponent component ) {
          if( component instanceof JSpinner ) {
              JSpinner spinner = (JSpinner) component;
              if( spinner.getEditor() instanceof JSpinner.DefaultEditor ) {
                  return ((JSpinner.DefaultEditor) spinner.getEditor()).getTextField();
              } else if( spinner.getEditor() instanceof JTextField ) {
                  return (JTextField) spinner.getEditor();
              } else {
                  logger.warn("Cannot use JSpinner editor of type " + spinner.getEditor().getClass());
                  return null;
              }
          } else if(component instanceof JTextComponent) {
              return (JTextComponent) component;
          } else {
              return null;
          }
      }
docs: Converts the given component to a <code>JTextComponent</code>. This can be a
  simple cast if the component is already a text component, or an embedded component
  (for example a JSpinner).
  <p>
  This method is protected, and can be overridden when necessary.
  
  @param component the component
  @return a <code>JTextComponent</code>, or <code>null</code>