Here you can find the source of setSpinnerValue(JSpinner spinner, Integer i)
public static void setSpinnerValue(JSpinner spinner, Integer i)
//package com.java2s; //License from project: Open Source License import javax.swing.*; public class Main { public static void setSpinnerValue(JSpinner spinner, Integer i) { if (i == null) { spinner.setValue(-1);/* w w w. j ava 2s . c o m*/ } else { spinner.setValue(i); } } }