When developing a program in the above language, I was faced with the following question: where is it better to declare listeners for visual elements?
The essence of my task is as follows: developing an engineering calculator. I estimated approximately, on the frame not less than 50 buttons will be placed
The ClInitVisualElements class declares and initializes the form with 50 buttons on it in its procedures.
I am stumped when creating listeners for these window elements. I understand that you can declare listeners:
In the constructor (but I immediately reject this option), since more than one person explained to me that in the constructor there should be only a call to a single procedure
In a separate procedure of the ClInitVisualElements class
In a separate method of which other class, for example,
CInitFrameListenersand call this method when creating visual elements
If anyone has experience in developing JAVA programs, then tell me, please, what would be the right thing to do from the professional point of view of code organization?
Thanks in advance.