Advanced Examples to JavaFX |
|
After developing Hello application, we are now going to create some more examples having different
features. We will develop examples:
1. Text Animation Example
2. Circle Moving Example
3. Clock in JavaFX
4. Graphics Example
5. Creating Progress Bar
6. Media Player Example
7. Login Application
8. Applet Example
9. Creating Slider
(I) Animation Examples
1. Text Animation Example
2. Circle Moving Example
1. Text Animation Example
To create Animation in JavaFX Script we have to use “javafx.animation” package and its classes.
Package javafxanimation;
/**
* @author Amit
*/
import javafx.ext.swing.*;
import javafx.scene.geometry.*;
import javafx.scene.paint.*;
import javafx.animation.*;
import java.lang.System;
import javafx.scene.text.Text;
import javafx.scene.Font;
import javafx.scene.FontStyle;
var x = 0;
var t = Timeline {
repeatCount: 100
autoReverse: true
keyFrames: [KeyFrame{time : 0s
values: x => 0},
KeyFrame{time : 2s
values: x => 100 tween Interpolator.EASEBOTH}
]
}
SwingFrame {
title: “Animation”
width: 250 |
|
Aug
2008 | Java Jazz Up |32 |
|
|
|
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 |
|
|
|