Example usage for javafx.beans.property IntegerProperty removeListener

List of usage examples for javafx.beans.property IntegerProperty removeListener

Introduction

In this page you can find the example usage for javafx.beans.property IntegerProperty removeListener.

Prototype

void removeListener(ChangeListener<? super T> listener);

Source Link

Document

Removes the given listener from the list of listeners that are notified whenever the value of the ObservableValue changes.

Usage

From source file:Main.java

public static void main(String[] args) {
    IntegerProperty intProperty = new SimpleIntegerProperty(1024);
    final ChangeListener changeListener = new ChangeListener() {
        @Override/*  w w  w.  j a v  a  2s. c om*/
        public void changed(ObservableValue observableValue, Object oldValue, Object newValue) {
            System.out.println("oldValue:" + oldValue + ", newValue = " + newValue);
        }
    };

    intProperty.addListener(changeListener);
    intProperty.set(5120);

    intProperty.removeListener(changeListener);

    intProperty.set(6144);
}