Can anyone help me with a minor bump? I'm using NetBeans and I'm doing an assignment in a JPanel/JFrame application. I need to know how to make a letter necessary for a log in page.
For example: to enter the page, you've to enter your I.D number; x12345678.
I'd like to know how to enter this in an if statement
Here's a line of code from a button action when clicked to show an error message:
private void submitBtnClicked(java.awt.event.ActionEvent evt) { if(nameTf.getText().length() == 0){ JOptionPane.showMessageDialog(null, "Invalid Name"); } if(studentTf.getText().length() == 0){ JOptionPane.showMessageDialog(null, "Invalid Student Number"); } }
Can anyone help me, please?