Advanced Examples to JavaFX |
|
|
Stop will stop animation.
Download Source Code
2. Circle Animation
To create animation with shape circle we have used “javafx.scene.geometry” package and “javafx.animation” package.
package javafxcircle;
import javafx.scene.geometry.Circle;
import javafx.scene.paint.Color;
import javafx.animation.Timeline;
import javafx.animation.KeyFrame;
import javafx.animation.Interpolator;
import javafx.ext.swing.*;
/**
* @author Amit
*/
var x = 30;
var y = 30;
var t = Timeline {
repeatCount: Timeline.INDEFINITE
autoReverse: true
keyFrames : [
KeyFrame {time : 0s
values: y => 30},
KeyFrame {time: 2s
values: y => 400 tween Interpolator.LINEAR},
KeyFrame {time : 1s
values: x => 30},
KeyFrame {time: 3s
values: x => 400 tween Interpolator.EASEIN},
KeyFrame {time : 2s
values: y => 400},
KeyFrame {time: 4s |
|
Aug
2008 | Java Jazz Up |34 |
|
|
|
Pages:
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63, Download PDF |
|
|
|