@Override
  public void setEditor(JComponent editor) {
    if (!(editor instanceof NumberEditor)) throw new IllegalArgumentException("JBSpinner allows NumberEditor only");
    super.setEditor(editor);
  }
@Override
  public void setEditor(JComponent editor)