30/09/2018, 18:22

How to Cast Object to double in Java

Hi.
I have a Jtable, now i want cast a cell (String Object) from SIDcol to double type

i tried

double sID= Jtable.getValueAt(5,1).DoubleValue();

it’'s not working, what i should do?

TTmagic viết 20:28 ngày 30/09/2018

Let’s try this and tell me does it work for you.

double sID= Double.parseDouble(Jtable.getValueAt(5,1).toString());
BigCat viết 20:24 ngày 30/09/2018

Thank you so much. I forgot to set string representation of the object. Its working

Bài liên quan
0