@FunctionalInterface public interface ChangeListener<T>
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, see the documentation of ObservableValue.
The same instance of ChangeListener can be registered to listen to
multiple ObservableValues.
ObservableValue| Modifier and Type | Method and Description |
|---|---|
void |
changed(ObservableValue<? extends T> observable,
T oldValue,
T newValue)
This method needs to be provided by an implementation of
ChangeListener. |
void changed(ObservableValue<? extends T> observable, T oldValue, T newValue)
ChangeListener. It is called if the value of an
ObservableValue changes.
In general is is considered bad practice to modify the observed value in this method.
observable - The ObservableValue which value changedoldValue - The old valuenewValue - The new valueCopyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.