String usn = jTextField1.getText();
String pwd = new String (jPasswordField1.getPassword());
if (usn.equals("hayley") && pwd.equals("hello")) {new Home().setVisible(true);}
else {alert("Invalid Username / Password (LOGIN FAILED)");}

Please see the following code above. I have been receiving problems such as "illegal start of expression" and ')' expected whenever I run my system, even though I have already double-checked them and seen no problems with it. BTW, this was declared in the "Set Action..." function of Netbeans IDE.

Hoping for a positive response! :D

on which line do you get that error message?
you are using classes and methods we can't know, so how do you want us to validate the above code?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.