Andre Brito wrote:Hi.
In my opinion, you're trying to kill a ant with a atomic bomb. I mean... If you're going to use exceptions for every code that a simple if resolves the problem, the system'll be complex.
I guess that, if I had the same question, I would treat the empty field with a simple if. If it is blank, show the alert message (or any other kind of message), saying that the default value is zero. Then, if it is blank, force that textfield to receive a zero.
Sorry my english.
Hug.
I agree-I just dont know how to code it:
My presumed pseudo code would be:
if (field == "NULL"){
field.setText(String.valueOf("0"));
errorBox.setText"String.valueOf("Please enter a valid value: ));
its the bit where the field == NULL-how is this written in
java?