I want to add two strings in java by getting data from two input fields. Result is shown in the 3rd field. I am using this code, but netbeans shows an error:
float num1,num2,result;
num1=Float.parseFloat(jTextField1.getText());
num2=Float.parseFloat(jTextField2.getText());
result=num1+num2;
jTextField3.setText(String.valueOf(result));
NumberFormatExceptionclearly states that.nameFieldso you know which one is which. You can do that by just right clicking the component from the design view and change variable name from the popup menu.