In a login screen, when a user submits a blank page without entering a username and password, it should show an error message. What methods should I use to check that the fields are blank when submitted?
What sort of object are you using for your input? A JTextField? If you are checking the input with the getText() methods, you get a String. There are methods for checking the length of Strings, so you can send out an error message if the length comes to zero.