@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 valueSubmit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2019, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.