Spec-Zone.ru › OpenJavaFX 8
javafx.beans.value

Interface ChangeListener<T>

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>
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, see the documentation of ObservableValue.

The same instance of ChangeListener can be registered to listen to multiple ObservableValues.

Since:

JavaFX 2.0

See Also:

ObservableValue

  • Method Summary

    All MethodsInstance MethodsAbstract Methods
    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.
  • Method Detail

    • changed

      void changed(ObservableValue<? extends T> observable,
                   T oldValue,
                   T newValue)
      This method needs to be provided by an implementation of 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.

      Parameters:

      observable - The ObservableValue which value changed

© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API