I have several panels in a JFrame window. Each time I will fill each panel differently. For example: I launched GUI: (image center panel, right panel, bottom panel). The central panel is filled with 20 buttons, the right panel with 10 buttons and the bottom panel with 3.
second launch of the GUI (the same gui). The central panel has 50 buttons, the right panel has 12 buttons, the bottom - 3.
Thus, each time a random number of buttons appear that cannot be unambiguously called. Given the fact that I do not have a unique name for each button (list only), I would like to know which buttons were pressed according to the panel to which they belong. is it possible?
source share