What is an animation?

From a JavaFX point of view, an animation is a change of a property over a period of time; for example:

  • If you want an object to move, you need to work with coordinate properties.
  • If you want to shrink or enlarge an object, you can use the scale property.
  • You can even use the Animation API for objects which don't have a visual representation at all.

You need the following three API classes to create an animation:

  • KeyFrame represents a point in time
  • KeyValue describes the value the desired property should have at the moment described by KeyFrame
  • Timeline collects all KeyFrame objects and runs the animation, calculating all intermediate values for properties between KeyFrame objects.

In the next section, we will review ...

Get Mastering JavaFX 10 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.