Java Swing - Problem in JSpinner

Posted by Yatendra Goel on Stack Overflow See other posts from Stack Overflow or by Yatendra Goel
Published on 2010-04-27T18:50:56Z Indexed on 2010/04/27 18:53 UTC
Read the original article Hit count: 197

Filed under:
|
|
|
|

I am developing a Java Desktop Application and designing the GUI with the help of Netbeans Swing GUI builder.

I want to use a JSpinner in my app. I have dragged and dropped it to a JPanel. Now, I want to set its two properties:

  • First, It should display numbers in the range of 1 to 50. Neither less than 1 nor greater than 50. How can I set that range?

  • Second, when I try to get the value of it by spinner.getValue() it returns an Object. As my spinner's data type is Integer, would it be better to downcast the Object into Integer or Is there any other way to get that numeric value?

© Stack Overflow or respective owner

Related posts about java

Related posts about swing