Im trying to make a simple calculation program but i keep getting this error whenever I try to run the code. How can i avoid this?
TextField inputOne = new TextField("Input first data");
// Making output 1
int inputNumber = Integer.parseInt(inputOne.getText());
Always get error message java.lang.reflect.InvocationTargetException at line 25 where the parse int is placed
getText() function returns the input value of the user, or the "Input first data" String? if it returns the input value of the user then it is probably a NumberFormatException that you should handle, else it is because the String mentioned is the mistake.