Reputation: 17765
Is there a library or technique to listen to all changeable events on swing ui objects? Specifically the data.
For instance, I have a JPanel with a JTextArea, JCheckBox, JComboBox, etc. Is there a common way to say "If the data in this changes, notify me"? I don't care about borders changing, and other UI event stuff, just user data changing.
I've tried propertychangelister, but I can't seem to find a common property, or a common class that will do this.
Upvotes: 2
Views: 113
Reputation: 205785
No, nothing common. You can listen directly to the model for those components that have a separable model. You can wrap the change in a PropertyChangeListener
, as shown here, in order to customize the message. The observer pattern is mentioned here.
Upvotes: 3