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.