I have this thing that I need to accept information from a user. I have a jTextField for where the user can place the info needed (example entering his name.) My problem is this.. I need to check whether the user has placed any text in the field. Since if he did not place any text I want an informtion message to be displayed on the same screen.
I created an empty jlabel so that it would be written there.. Though i did not succeed! I tried to check if the jTextField is empty by using if (jTextField.getText() == null) {
jLabel.setText("Name cannot be left blank");
}
Can please someone help me.. I thank you in advance