Original Post
I'm just fooling around on making a GUI (that I will probably use in games later) and I'm wondering what type of approach is "best" for my situation. I'm going to have a Window and\or Panel object which will contain a collection of buttons and textboxs. It will then cycle through the collections to see if any has been clicked and then take the appropriate action. It's easy to handle whether or not if the button has been clicked but I cannot think of a good approach to "define" what each button does without having a whole bunch of: if(button1.isClicked()){ Do Action }else if(button2.isClicked()){ Do a different action } Ect. for every button. Perhaps this is one of the better\only ways to go about it or maybe I will have to redesign the Button class. Nevertheless, any help would definitely be appreciated.