Java Reference
In-Depth Information
Figure 2-9. The MetronomeTransition program
The first noticeable difference between this example and the previous (Metronome1) example is that instead of
one end of a line moving back and forth, we're going to make a Circle node move back and forth.
The Behavior of the MetronomeTransition Program
Go ahead and run the program, and perform the same steps that you did in the previous exercise with Metronome1.
Everything should function the same, except for the visual difference pointed out previously.
Understanding the MetronomeTransition Program
Take a look at the code for the MetronomeTransition program in Listing 2-6, before we point out relevant concepts.
Listing 2-6. MetronomeTransitionMain.fx
package projavafx.metronometransition.ui;
import javafx.animation.Animation;
import javafx.animation.Interpolator;
import javafx.animation.TranslateTransition;
import javafx.application.Application;
Search WWH ::




Custom Search