Advanced Examples to JavaFX |
|
|
Download Source Code
(VII) JavaFX Applet Example
We can also create Applet Application with the use of JavaFX Script.
To create applet we have to create JavaFX Applet File. applet.fx
/*
* applet.fx
*
* Created on Aug 7, 2008, 1:08:44 PM
*/
package javafxapplet;
import javafx.application.*;
import javafx.scene.*;
import javafx.scene.text.*;
/**
* @author Amit
*/
Application{
stage: Stage{
content: Text {
x: 10, y: 30
content: “Application content”
font: Font { size: 24 style: FontStyle.PLAIN }
}
}
}
appletHtml.html
We can also add this applet file in HTML page with the following code:
<html>
<head>
<title></title>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8">
</head>
<body>
<applet height=”300" width=”400" archive=”lib/javafxrt.jar,JavaFXApplet.jar”
code=”javafx.application.Applet”>
<param name=”ApplicationClass” value=”javafxapplet.applet”/>
</applet>
</body>
</html>
|
|
Aug 2008 | Java Jazz Up | 52 |
|
|
|
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 |
|
|
|