public abstract void addListener (ChangeListener<? super T> listener)

Adds a ChangeListener which will be notified whenever the value of the ObservableValue changes. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.

Note that the same actual ChangeListener instance may be safely registered for different ObservableValues.

The ObservableValue stores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak. It is recommended to either unregister a listener by calling removeListener(ChangeListener) after use or to use an instance of WeakChangeListener avoid this situation.

listener     The listener to register

NullPointerException     if the listener is null

See also: