1-10. Binding Expressions

Problem

You want to synchronize changes between two values.

Solution

Use javafx.beans.binding.* and javafx.beans.property.* packages to bind variables. There is more than one scenario to consider when binding values or properties. This recipe demonstrates the following three binding strategies:

  • Bidirectional binding on a Java Bean
  • High-level binding using the Fluent API
  • Low-level binding using javafx.beans.binding.* Binding objects

The following code is a console application implementing these three strategies. The console application will output property values based on various binding scenarios. The first scenario is a bidirectional binding between a String property variable and a String property owned by a domain ...

Get JavaFX 2.0: Introduction by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.