Java examples for JavaFX:Bindable Properties
is Nan Or Infinity JavaFX BooleanBinding
//package com.java2s; import javafx.beans.binding.BooleanBinding; import javafx.beans.value.ObservableDoubleValue; public class Main { public static BooleanBinding isNanOrInfinity( final ObservableDoubleValue observable) { return new BooleanBinding() { {//from w w w.j a va 2 s.c om super.bind(observable); } @Override protected boolean computeValue() { double value = observable.get(); return Double.isInfinite(value) || Double.isNaN(value); } }; } }