We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I just created a Button class for my current project, and I'd like a way to assign a function to each button created.
It would be most useful to store the function as a variable upon calling the constructor and later call that function when a click is detected inside the Button. After searching the forums I see it's rather difficult to do this, and it's also a bad idea to store the function name as a String and use that to call it.
I'd like to avoid hard coding the functions for each button into a clickHandler function. Do you guys have suggestions on what to do?