How do you get values ββfrom a text field like jTextField3.getText(); .
Since this is textField , it will return you a string format, as its format says:
String getText()
Returns the text contained in this TextComponent.
So, convert String to Integer as follows:
int jml = Integer.parseInt(jTextField3.getText());
instead of direct installation
int jml = jTextField3.getText();
Parth
source share