Source Code : InvalidationListener for IntegerProperty

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

InvalidationListener for IntegerProperty

 

import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;

public class Main {
  public static void main(String[] args) {
    IntegerProperty intProperty = new SimpleIntegerProperty(1024);
    final InvalidationListener invalidationListener = new InvalidationListener() {
      @Override
      public void invalidated(Observable observable) {
        System.out.println("invalidated: " + observable);
      }
    };

    intProperty.addListener(invalidationListener);

    intProperty.set(2048);

    intProperty.removeListener(invalidationListener);
    intProperty.set(4096);
  }
}

   
  

Thank with us