• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

retrieving and storing password from and to hashtable

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
tom brownlee
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Being a smart alec beats the alternative. This tiny ad knows what I'm talking about:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic