-
Book Overview & Buying
-
Table Of Contents
JavaFX 1.2 Application Development Cookbook
By :
As you create more elaborate animation, you will run into situations where you want to synchronize object movements in your animation sequences. You can do that by declaring several instances of Timeline, or you can automate the synchronization of your objects using bound variables. This recipe shows you how to use data binding to update object properties automatically during an animation sequence.
This recipe uses the Timeline and KeyFrame classes to create animation sequences. If you are not familiar with keyframe-based animation, review the recipe Building animation with the KeyFrame API. This recipe also includes the notion of data binding covered under Using binding and triggers to update variables in Chapter 1,
The next code snippet illustrates how to use data binding in keyframe-based animation. We will animate several objects synchronously using only one timeline. You can see the full code in ch03/source...
Change the font size
Change margin width
Change background colour