code: public static void setSpinnerDraggingEnabled(
          final JSpinner spinner, boolean enabled)
      {
          SpinnerModel spinnerModel = spinner.getModel();
          if (!(spinnerModel instanceof SpinnerNumberModel))
          {
              throw new IllegalArgumentException(
                  "Dragging is only possible for spinners with a " +
                  "SpinnerNumberModel, found "+spinnerModel.getClass());
          }
          
          if (enabled)
          {
              disableSpinnerDragging(spinner);
              enableSpinnerDragging(spinner);
          }
          else
          {
              disableSpinnerDragging(spinner);
          }
      }
docs: Set whether the value of the given spinner may be changed with
  mouse drags
  
  @param spinner The spinner
  @param enabled Whether dragging is enabled
  @throws IllegalArgumentException If the given spinner does not
  have a SpinnerNumberModel