I am developing a billing program, I need to insert a data type int
but I get an error this is the line:
Item ite = new Item();
ite.setPrecio(txt_precio.getText());
I am developing a billing program, I need to insert a data type int
but I get an error this is the line:
Item ite = new Item();
ite.setPrecio(txt_precio.getText());
The error is in trying to save a String in a Double field.
I leave you information on how to do parseDouble
Double
This would be an example
String texto = "22.600"; // example String
double valor = Double.parseDouble(texto);
And with your code would be
double valor = Double.parseDouble(txt_precio.getText());
ite.setPrecio(valor);