• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can not pull data from the has map

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can not get the find button to return the data from the hash map. I have tried everything I can think of with using the key, get, from the hashmap.
If more code is need let me know.
 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem here might become a little bit clearer if you split your method into three functions:

Now, every time you enter the action performed method, a new HashTable is created and assigned to the myObjects local variable. If the find button is pressed, it calls the find button's method.
What you want to do is make the myObjects a member variable. It will then be accessible from every method. Just remember that you only need to initialize it once (not on every button click), or else you will have the same problem.
 
reply
    Bookmark Topic Watch Topic
  • New Topic