Hello, my application shows a profile. The profile has various interactors. I'm trying to follow the MVC model, so I neeed to tell my controller that something was selected. But the profile has many elements that can be selected(mostly labels, so not setActionCommand), how do I tell it WHICH one was it?
I understand that I will need to use some kind of(probably a custom one) listener. But the main problem is how do I separate those interactors?
--- Update ---
I solved it myself. I created a HashMap that maps from JLabels to Strings. When a mouse event occurs I loop trough it to search for the event source. If I find it I fire my custom event.