-
Book Overview & Buying
-
Table Of Contents
JavaFX 1.2 Application Development Cookbook
By :
The recipe Building animation with the KeyFrame API introduced the notion of keyframe animation using Interpolator instances to automatically calculate the in-between values between starting and ending keyframes. As of version 1.2, JavaFX comes with five interpolators including Interpolator.EASEIN, Interpolator.EASEOUT, Interpolator.BOTH, Interpolator.LINEAR, and Interpolator.DISCRETE (see Building animation with the KeyFrame API for details).
While these interpolators are adequate for most animation sequences, you may, however, encounter situations where you want your objects to behave differently than the ways offered by the built-in interpolators. In this recipe, we will show you how to create your own custom Interpolator class.
This recipe uses keyframe animation concepts supported by the Timeline and KeyFrame classes to create animation sequences. If you are not familiar with keyframe-based animation in JavaFX, review recipe...
Change the font size
Change margin width
Change background colour