I'm getting a Java: 10: error for line 7, when I compile the code listed below. This is sample given to us for this weeks assignment to tailor to meet requirements of the project and I know this same code has popped up repeated on Stack.
import javax.swing.JOptionPane;
public class ProjectTwo
{
public static void main(String[] args)
{
String input;
input = JOptionPane.showInputDialog("Enter a password.");
if (!PasswordVerifier.isValid(input))
JOptionPane.showMessageDialog(null, "Invalid password.");
else
JOptionPane.showMessageDialog(null, "Valid password.");
System.exit(0);
}
}
Based off the error, I believe I haven't imported the correct utility to use the PasswordVerifier
function. I've been digging through:
- docs.oracle.com
to find possibly what element of javax.swing is applicable to import, with no luck. Any help would be greatly appreciated.