Results 1 to 4 of 4
Thread: HashMaps containing JComponents
- 05-03-2011, 08:47 PM #1
Member
- Join Date
- May 2011
- Posts
- 2
- Rep Power
- 0
HashMaps containing JComponents
Hey all,
I've got a 2D HashMap, in which there are JCheckBoxes, JButtons, and JTextFields, so it's like: HashMap <String, HashMap<String, JComponent>>. I add JComponents dynamically to it. My goal is to add some listener to the JComponents, which is able to indicate either the user clicked on the button, or checked the checkbox, and to be able to get to know the key which belongs to the chosen JComponent.
Can anyone help me? I'd appreciate your help.
-
Perhaps it's me, but I'm not sure what specifically you need help with.
- 05-03-2011, 10:17 PM #3
Member
- Join Date
- May 2011
- Posts
- 2
- Rep Power
- 0
Thank you for your answer. I'm sorry if I wasn't exact enough. My question is: which listener should I add to my Hashmap/JComponent to reach my goal? Since I handle my CheckBoxes, ect. together, I can't use ItemListener, or any other specific listeners.
It's important to get to know what happened, and which key belongs to the JComponent which sent the event.
-
I'm not sure why you're using this design and what you're trying to achieve from it, but perhaps there is another and better way to achieve your end goals. Please give us more information on the problem you're trying to solve from the user's perspective and not from a specific code solution perspective.
Similar Threads
-
hashmaps
By santa in forum New To JavaReplies: 6Last Post: 05-03-2011, 11:07 PM -
JComponents Are Wrong Size
By MrFish in forum AWT / SwingReplies: 2Last Post: 12-21-2010, 03:13 AM -
Concerning HashMaps
By hjensen in forum New To JavaReplies: 7Last Post: 10-18-2010, 03:36 PM -
Problems with HashMaps
By li_bi in forum New To JavaReplies: 13Last Post: 02-24-2010, 12:08 PM -
HashMaps get key for a specific value
By andre1011 in forum Advanced JavaReplies: 2Last Post: 03-11-2009, 02:30 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks