java - How to show a notification to the user if a textfield is left blank -
how can show joptionpane
notification user when textfield left blank?
i new java
i made button submit name, , if user submits blank, gets blank also. there method textfield determine whether textfield blank or not, can give alert textfield blank joptionpane
?
in button's actionlistener:
if (textfield.gettext().isempty()) { joptionpane.showmessagedialog(textfield, "beware: left text field blank"); } else { proceedasusual(); }
java input textfield
No comments:
Post a Comment