Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert double to object?

I am writing part of my program which read data from a txt file.

I have problem when I want to set value of JSpinner by setValue(object).

My data is double so I need to convert it to object, but how?

LoadData open = new LoadData();
data.setFz(open.giveAwayData());
spinner_1.setValue(data.getFz()); // Fz is double
like image 291
Xalion Avatar asked Feb 10 '23 04:02

Xalion


1 Answers

Try casting it to Double (with capital):

spinner_1.setValue((Double) data.getFz());
like image 76
colouredmirrorball Avatar answered Feb 11 '23 17:02

colouredmirrorball