aspose file tools*
The moose likes Java in General and the fly likes Matching HashMap Key To Value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Matching HashMap Key To Value" Watch "Matching HashMap Key To Value" New topic
Author

Matching HashMap Key To Value

henri henri
Ranch Hand

Joined: Oct 03, 2005
Posts: 115
Hello, I am trying to write a program that stores information about film titles in JavaBean components. When a user clicks on a button with a letter from A to Z, the letter is fed to the setFilmData() method where a list of all the film titles beginning with that letter are retrieved. I am unsure of how to match the keys with the corresponding values. Please see the link which has a screenshot of the user interface. I would like the data in each JavaBean to end up in the JTable you see in the program.

http://pollscanada.com/screenshot.html




Kevin Davies
Greenhorn

Joined: Jun 20, 2005
Posts: 14
Where are the values being kept? It seems like it would be most logically to keep them in a TreeMap and not use the TreeSet at all. In the map you could just call
henri henri
Ranch Hand

Joined: Oct 03, 2005
Posts: 115
The values are stored in a HashMap along with keys which are the film titles. Once I have the title, I need the corresponding Bean to extracted the encapsulated information about the film. I am creating the software for an illiterate person, so I need to make it as intuitive and easy as possible for this particular user.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Matching HashMap Key To Value