JSpinner with

H

Herbert Eberhart

Hi!

I want to set the value of a JSpinner with SpinnerNumberModel for
double-Values.

How can i set the Value of a JSpinner with SpinnerNumberModel
(double)?

With the int-SpinnerNumberModel it works, but I get an invalid
value-Exception when i try to set the value of the JSpinner with
double-SpinnerNumberModel:

SpinnerNumberModel m_d = new SpinnerNumberModel(-4.0, -100.0, 100.0,
1.0);
JSpinner sp = new JSpinner(m_d);

double d;
String s = "" + d;
sp.setValue(s);


Thanks in advance
Herbert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top