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 Can not pull data from the has map Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Can not pull data from the has map" Watch "Can not pull data from the has map" New topic
Author

Can not pull data from the has map

jon ladd
Ranch Hand

Joined: Feb 11, 2003
Posts: 53
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.
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

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.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Can not pull data from the has map
 
Similar Threads
having problems getting my Runnable Interface working
Binary Search Tree Freezes
Adding Exception error problems
about criteriaFind
Binary Search Tree Freezes