if (this.editor instanceof DefaultEditor) ((DefaultEditor) editor).dismiss(this); else if (this.editor instanceof ChangeListener) removeChangeListener((ChangeListener) this.editor);  if (editor instanceof ChangeListener) addChangeListener((ChangeListener) editor);
JComponent oldEditor = this.editor; if (oldEditor instanceof DefaultEditor) ((DefaultEditor) oldEditor).dismiss(this); else if (oldEditor instanceof ChangeListener) removeChangeListener((ChangeListener) oldEditor);
  public void setEditor(JComponent editor)  {    if (editor == null)      throw new IllegalArgumentException("editor may not be null");    if (this.editor instanceof DefaultEditor)      ((DefaultEditor) editor).dismiss(this);    else if (this.editor instanceof ChangeListener)      removeChangeListener((ChangeListener) this.editor);    if (editor instanceof ChangeListener)      addChangeListener((ChangeListener) editor);    this.editor = editor;  }