I already have a class called validation that looks like this:
package Information;
public class Validation {
public static boolean emptyString(String s) {
if (s == null || s.isEmpty()) {
return true;
} else {
return false;
}
}
}
This is my Jframe class:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
if (Validation.emptyString(jTextField1.getText()) || Validation.emptyString(jTextField2.getText()))
{
JOptionPane.showMessageDialog(null, "Don't leave fields empty");
} else {
if (testaAdmin(jTextField1.getText(), jTextField2.getText())) {
Basen basenFrame = new Basen();
basenFrame.setVisible(true);
this.dispose();
} else {
JOptionPane.showMessageDialog(null, "Wrong username or password");
}
}
}
The problem is that Validation in the Jframe class doesn't seem to get that it is supposed to communicate with the Validation class.
It just gives me this error message:
error: cannot find symbol Validation.emptyString(jTextField2.getText()))
Why is this?