This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Matching HashMap Key To Value

 
henri henri
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic