9. Binding

Binding enables you to link one value in a JavaFX application to another so that if the second value changes, the first is automatically updated and stays in step with it. You can bind a value to a script variable, an instance variable of a JavaFX class, an expression (including a block expression), the return value of a function, a sequence, or a part of a sequence. The most common uses for binding in JavaFX involve linking GUI components or the properties of a graphical node to some kind of state in an underlying model, and this is also the easiest and most direct way to demonstrate what can be done with binding. For that reason, many of the examples in this section use GUI components that we have not yet discussed in any detail. ...

Get JavaFX™ Developer’s Guide 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.