public static JSpinner getJSpinnerInstance(Field field, double value, boolean inSpreadSheet) {
double min = 0;
double max = MAX_VALUE;
double step = 0.5;
double spinnerValue = value;
Range range = field.getRange();
if (range != null) {
max = range.getMaximum();
min = range.getMinimum();
step = range.getStep();
spinnerValue = Math.max(min,Math.min(value,max)); // put in range
}
// Set focus to editor always