Getting JSpinner value into integer

Posted on 2003-02-26
Medium Priority
Last Modified: 2008-03-04
How do I get the value of JSpinner in a int field??
Question by:RdeLange
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 18

Accepted Solution

bobbit31 earned 200 total points
ID: 8027350
store it as an Integer

js.setValue(new Integer(1));

to get it back as int:

int jsVal = ((Integer) js.getValue()).intValue());

Author Comment

ID: 8027437
Thanks, this works! Only the last ) must be left.

LVL 18

Expert Comment

ID: 8027466
oh yeah, sorry ;)
LVL 18

Expert Comment

ID: 8028213
so is this problem solved?

if so, please accept comment as answer so we can keep this topic area clean ;)

Expert Comment

ID: 8049318
Hi RdeLange,

it appears bobbit31's answer helped you. please select his comment as an answer by clicking the link at the top of his post called "Accept answer as comment" and give him a grade and close it out. If no action I will do this myself in 72 hours. Thank You

CS Moderator

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month9 days, 12 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question