Java Swing Tutorial - 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.

// www .j ava2  s .c  o  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));
  }
}