File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes retrieving and storing password from and to hashtable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "retrieving and storing password from and to hashtable" Watch "retrieving and storing password from and to hashtable" New topic
Author

retrieving and storing password from and to hashtable

tom brownlee
Greenhorn

Joined: Aug 14, 2001
Posts: 28
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.
tom brownlee
Greenhorn

Joined: Aug 14, 2001
Posts: 28
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

tom
tom brownlee
Greenhorn

Joined: Aug 14, 2001
Posts: 28
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?

thanks guys
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
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?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
tom brownlee
Greenhorn

Joined: Aug 14, 2001
Posts: 28
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: retrieving and storing password from and to hashtable
 
Similar Threads
JLabel
GridBagLayout...!
How to make the window (JPanel?) bigger in gridbaglayout
JScrollPane Weight Shift In GridBagLayout
help automate code