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 ) ; } }
Set whether the value of the given spinner may be changed with mouse drags