Java JSpinner.setValue(Object value)

Syntax

JSpinner.setValue(Object value) has the following syntax.

public void setValue(Object value)

Example

In the following code shows how to use JSpinner.setValue(Object value) method.


//from w  w w . j a v  a  2 s .  co m
import javax.swing.JSpinner;

public class Main {
  public static void main(String[] argv) throws Exception {
    // Create a number spinner
    JSpinner spinner = new JSpinner();

    // Set its value
    spinner.setValue(new Integer(100));
  }
}