I have a program with a Save() method that saves all data in spinners and textfields on the form. Is there a way to call “Save()” every time the user makes a change to a textfield or spinner? Something similar to a generic event handler.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can hook up a single instance of ChangeListener to all your controls, which could look like (when an inner class):
to add this listener in one go you can loop over the children of your
Containerlike this:you have to look for the different types of components because there is no interface which defines the
addChangeListener(..)method (that I am aware of).