I have to write a program that has a log-in window.
I need to check if the username and the password all satisfy what is written in a text file.
the text file which has named as: "pass" contains the following : Admin:icsPro8%
In my validUserName method, I wrote these two lines under the try block to extract what is in the text file "pass" :
try{
InputFile = new Scanner(new FileInputStream("pass.txt"));
String name = InputFile.nextLine();
}
But unfortunately, I got this error: "name has private access in java.awt.Component" why this happened ? and how to fix it ?