java detect clicked buttons
- by user253530
I have multiple panels on a JFrame window. I am going to populate each panel differently every time. For example:
i start the GUI: (image center panel, right panel, bottom panel). Center panel is populated with 20 buttons, right panel with 10 buttons and bottom panel with 3.
second start of the GUI (same gui). Center panel has 50 buttons, right panel has 12 buttons, bottom has 3.
So everytime there is a random number of buttons, impossible to be all uniquely named.
Given the fact that I don't have a unique name for each button (just a list) I would like to know which buttons were clicked according to the panel they belong to. is that possible?