hello there, my problem is one of frustration and impatience. I have a swing GUI interface (code written below)that asks for a code and a password. I need to check the validity of both to enable the program to proceed. how do i acccomplish this? The code and password has to be stored somewhere in the program. (hashtable or vector or file etc). As you may see when running the code, i also have to store and be able to retrieve information when put in by a user, but i thought id start out slowly. I am a reasonably competent java user, so please throw anything at me My apologise if this isnt a beginner question, it seemed a good place to start.
thanks all. tom.
Joined: Aug 14, 2001
Sorry Guys... im using BlueJ to run my java code and therefore im using a TestRunner class to run my code. I didnt include the main() method to run the code when i posted it to you. here it is
Joined: Aug 14, 2001
Well ive discovered a crude but working way to implement my validation but now i need to know how to store user information ( firstname, lastname etc) into a hashtable and retrieve this information based upon the employee code entered in the employee code textfield. therefore when the first code and password are valid the employee code is entered which should return the information of the appropriate employee with that code, but if it doesnt the user can enter new information and then store this via a GUI "add" button any help?
tom, I'm not sure I'm understanding your question(s). Your initial question seemed to be "What data structure should I use?" and you've apparently settled on a HashTable for at least some of the data. Now, regarding your most recent consideration, are you wanting the data to persist between uses of the application? Or is this simply a "How do I use a HashTable?" question?
Hi dirk, , my apologise for the confusion after i posted the question i conceived the answer i needed. my next question that you ask about is this. how do i store (save) a users details (first name, last name etc.) so that when they enter or re-enter their "code" they will be able to see these entries (first name, last name etc). also how do i implement saving details if the users code does not exist and they are able to enter details to be saved under this code (and hence re-entering the code to see these newly added details) or when they wish to modify their details? does that make more sense dirk? thanks for the help, i truly appreciate it. tom