Interface ChangeListener<T>
- Type Parameters:
T- the observable value type
- All Known Implementing Classes:
WeakChangeListener
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A
ChangeListener is notified whenever the value of an
ObservableValue changes. It can be registered and unregistered with
ObservableValue.addListener(ChangeListener) respectively
ObservableValue.removeListener(ChangeListener)
For an in-depth explanation of change events and how they differ from
invalidation events, and for the guarantees provided by the implementations in
the JavaFX library, see the documentation of ObservableValue.
The same instance of ChangeListener can be registered to listen to
multiple ObservableValues.
- Since:
- JavaFX 2.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidchanged(ObservableValue<? extends T> observable, T oldValue, T newValue) Called when the value of anObservableValuechanges.
-
Method Details
-
changed
Called when the value of anObservableValuechanges.In general, it is considered bad practice to modify the observed value in this method.
- Parameters:
observable- TheObservableValuewhich value changedoldValue- The old valuenewValue- The new value
-