eclipse/nebula

PWIntegerText exception when delete content

vicenrico opened this issue · 5 comments

If I movie to a PWIntegerText control, delete the content and because there is an empty string, it raises an exception.
Exception in thread "main" java.lang.NumberFormatException: For input string: ""

Dude, read this bug report and tell us how we should help you with this information.

Dude, read this bug report and tell us how we should help you with this information.

Well I mean. Pwintegertext control doesn't check for empty strings and when it occurs, it raises an exception. Could you fix it? Thx

jantje commented

IMHO an empty string is not a valid integer text so an exception seems what should happen.

IMHO an empty string is not a valid integer text so an exception seems what should happen.

Well, I don't think so, because I entered number 10. I realized the mistake and wanted to enter another number. In order to do that, I deleted the previous value 10, so I got an exception. How do I correct a mistake if I'm not able to delete the previous value?. Maybe would be good do the checking in a focusOut listener?

@vicenrico I see. Thanks for reporting. Can you supply a patch? I guess the empty string should be 0.