JTextField text=new JTextField();
text.gettext();
//I want text.gettext(); value to be a float value to calculate a problem . How to take it as ??
JTextField text=new JTextField();
text.gettext();
//I want text.gettext(); value to be a float value to calculate a problem . How to take it as ??
In order to read a float from a text field you can do it two ways.
String a=text.getText();//Create a string to store the incoming data
float f = Float.parseFloat(a);// to cast the data
Else
float f = Float.parseFloat(text.getText);