Validation of java fields

Asked

Viewed 57 times

1

People as I do a check in java SE for some data, to return a message and ask again this information if it is incorrect, in an elegant way following the good practices of object orientation?

  • I believe that question is mainly based on opinions and such questions are not accepted here. You can edit your question if you have a more concrete question...

1 answer

1


See if you can help:

if (txtNome.getText().isEmpty()) {
     exibeMensagem();
     txtNome.requestFocus();
     return;
}

If it doesn’t help, improve your question a little and specify your problem better, as @Jéferson Bueno suggested.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.