Link to home
Start Free TrialLog in
Avatar of Tolgar
Tolgar

asked on

How to get the key of a value in a hashmap in Java?

How can I get the key of a value in a hashmap?

The reason, I am asking this is because I need to remove items from a hashmap but I can only know the value at the time I want to remove the key, value pair.

If I can get the key then i can use this key to remove the key,value pair from the hashmap.

How can I get the key then?

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tolgar
Tolgar

ASKER

Yes, I found it. Thanks. Actually, i fixed this problem. My code works but UI still hangs.

I cannot figure out why?
You're using SWT are you not?
Avatar of Tolgar

ASKER

Yes, I do.
I can't help i'm afraid. I don't do SWT
Avatar of Tolgar

ASKER

ok. No problem.

mccarl is helping me now.