Question
ive encountered a little challenge
ive tried to make my program detect an error
i.e such as NaN and then it displays a message dialog saying Syntax error
the problem is this works but the dialog keeps poping up when simple arithmetics are performed with proper answers NaN and Infinity
what i would like to achieve is just NaN or Infinity etc detected not everything
i.e
txtNumber1 ......N1
txtNumber2
sum=N1+N2
Answer=value of (sum);
i want the dialog to appear when Nan or Infinit appears in the Answer text
ive tried if but fails to detect it
i.e
if (sum).equals("NaN");
Messadialog appears saying syntax, math etc errors
||
if (sum).equals("Infinity");
Messadialog appears saying syntax, math etc errors user presses OK then refreshes the panel
this is where your expertise fits in
thanks