Module javafx.base

Class When

java.lang.Object
javafx.beans.binding.When

public class When extends Object
Starting point for a binding that calculates a ternary expression.

A ternary expression has the basic form new When(cond).then(value1).otherwise(value2);. The expression cond needs to be a ObservableBooleanValue. Based on the value of cond, the binding contains the value of value1 (if cond.getValue() == true) or value2 (if cond.getValue() == false). The values value1 and value2 have to be of the same type. They can be constant values or implementations of ObservableValue.

Since:
JavaFX 2.0