Okay, I was wondering if someone can explain, in great detail, how to make my JPasswordField save the contents that where entered into it, into a .txt file. So when I open the program again, I can have that person log in and it will get if thats the password or not. If it is the password, then the JOptionPane will close. I have this all in a JFrame, and the "Log In" button is in a JMenuBar in a JMenu, named "File". In the text file, I'd like to have the user enter a username and password, and it will set a username and a password to that user, like this. ex.
Username = Gavin
Password = 123
So if there are ways of just storing a certain variable, to that text file and make the program load that variables value, it'd be great if you can explain. I am also very open to spoonfeeding because I don't just take and use it, no. I'm going to look at it, figure out why it works because I'm going to work on duplicating it in a different way. Thanks in advance!
P.S. Yes, I did do some research, but the problem is, people would put a code that I have no clue on how it may start to work, I am farely new to Java programming. So, please do paste codes, I will study them, but if you can also throw in a minor explanation.