-
- 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.
@FunctionalInterface public interface ChangeListener<T>
AChangeListeneris notified whenever the value of anObservableValuechanges. It can be registered and unregistered withObservableValue.addListener(ChangeListener)respectivelyObservableValue.removeListener(ChangeListener)For an in-depth explanation of change events and how they differ from invalidation events, see the documentation of
ObservableValue.The same instance of
ChangeListenercan be registered to listen to multipleObservableValues.- Since:
- JavaFX 2.0
- See Also:
ObservableValue
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidchanged(ObservableValue<? extends T> observable, T oldValue, T newValue)This method needs to be provided by an implementation ofChangeListener.
-
-
-
Method Detail
-
changed
void changed(ObservableValue<? extends T> observable, T oldValue, T newValue)
This method needs to be provided by an implementation ofChangeListener. It is called if 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
-
-