Java - Recommended Ways for Validation of Blank Entries -
good day!
i new programming esp. java , have problem regarding validation. want create validation wherein blank entries not accepted. if call code:
entry[i].setname(joptionpane.showinputdialog("enter name: ")); if entry blank, not accepted , error prompt:
cannot accept blank entries! of course remedied doing code:
string name = joptionpane.showinputdialog("enter name: "); while (name.equals("")){ joptionpane.showmessagedialog(null, "cannot accept blank entries!"); name = joptionpane.showinputdialog("enter name: "); } but if want validate 100 fields don't want have blank entries, code messy , long...
so how better? i've read using getters , setters or try-catch methods validation don't know if kind of validation applicable. , don't know how it. (iam not experienced in programming) , if applicable, violating model-view-controller concept if included joption message dialog box on getter , setter methods? codes programmers in doing blank entries validation???
your opinion highly appreciated.
i think article how add validation code swing uis out.
Comments
Post a Comment