code: public static JSpinner createSpinner(
          SpinnerModel model, final int fractionDigits)
      {
          return new JSpinner(model)
          {
              /**
               * Serial UID
               */
              private static final long serialVersionUID = -9185142711286020504L;
  
              @Override
              protected JComponent createEditor(SpinnerModel model) 
              {
                  if (model instanceof SpinnerNumberModel) 
                  {
                      NumberEditor editor = new NumberEditor(this);
                      DecimalFormat format = editor.getFormat();
                      format.setMaximumFractionDigits(fractionDigits);
                      return editor;                    
                  }
                  return super.createEditor(model);
              }
          };
      }
docs: Create a spinner with the given model, showing the given number
  of fraction digits for number models
  
  @param model The model
  @param fractionDigits The fraction digits
  @return The spinner