Java Swing Tutorial - Java JSpinner.getValue()








Syntax

JSpinner.getValue() has the following syntax.

public Object getValue()

Example

In the following code shows how to use JSpinner.getValue() method.

/*w w w  . j a  v a 2  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));
    
    
    System.out.println(spinner.getValue());
  }
}