Example usage for javafx.beans Observable toString

List of usage examples for javafx.beans Observable toString

Introduction

In this page you can find the example usage for javafx.beans Observable toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:Main.java

public static void main(String[] args) {
        SimpleIntegerProperty xProperty = new SimpleIntegerProperty(0);

        // Adding a invalidation listener (anonymous inner class)
        xProperty.addListener(new InvalidationListener() {
            @Override/* ww w . jav  a  2s.  co m*/
            public void invalidated(Observable o) {
                System.out.println(o.toString());
            }
        });

        // Adding a invalidation listener (lambda expression)
        xProperty.addListener((Observable o) -> {
            System.out.println(o.toString());
        });

    }