How do I do a check in java SE for some data, to return a message and request this information again if it is incorrect, in an elegant way following good practices of object orientation?
How do I do a check in java SE for some data, to return a message and request this information again if it is incorrect, in an elegant way following good practices of object orientation?
See if you can help:
if (txtNome.getText().isEmpty()) {
exibeMensagem();
txtNome.requestFocus();
return;
}
If it does not help, please improve your question a bit and specify your problem better, as @ Jéferson Bueno suggested.