O'Reilly logo

JavaFX 2.0: Introduction by Example by Carl Dea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required