JavaFx运行时的下载地址:
http://javafx.com/downloads/all.jsp
我的appspot地址,打开即可看到示例:
http://sonicluo3.appspot.com/
JavaFx的主方法 MyJavaFXStage.fx
Java代码
- package org.webbiscuit;
- import javafx.scene.*;
- import javafx.scene.image.*;
- import javafx.stage.*;
- import javafx.scene.text.*;
- /**
- * @author sonic
- */
- Stage {
- title: "Application title"
- width: 300
- height: 280
- scene: Scene {
- content:[
- Text {
- font : Font {
- size : 16
- }
- x: 10, y: 200
- content: "Hello,这是一个 JavaFx + 可拖动Applet\n+ GAE 的应用! It's very cool!!"
- },
- ImageView { image: Image { url: "{__DIR__}GAE_java.png" } }
- ]
- }
- }
- package org.webbiscuit;
- import javafx.scene.*;
- import javafx.scene.image.*;
- import javafx.stage.*;
- import javafx.scene.text.*;
- /**
- * @author sonic
- */
- Stage {
- title: "Application title"
- width: 300
- height: 280
- scene: Scene {
- content:[
- Text {
- font : Font {
- size : 16
- }
- x: 10, y: 200
- content: "Hello,这是一个 JavaFx + 可拖动Applet\n+ GAE 的应用! It's very cool!!"
- },
- ImageView { image: Image { url: "{__DIR__}GAE_java.png" } }
- ]
- }
- }
部署的html文件如下,内嵌了JavaFx的Applet.
Html代码
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>JavaFXApplet</title>
- </head>
- <body>
- <h2>按住 Alt 键,然后拖动鼠标就可以把Applet拉到桌面了.</h2>
- <script src="http://dl.javafx.com/1.1/dtfx.js"></script>
- <script>
- javafx(
- {
- archive: "JavaFXApplet.jar",
- draggable: true,
- width: 300,
- height: 280,
- code: "org.webbiscuit.MyJavaFXStage",
- name: "JavaFXApplet"
- }
- );
- </script>
- </body>
- </html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>JavaFXApplet</title>
- </head>
- <body>
- <h2>按住 Alt 键,然后拖动鼠标就可以把Applet拉到桌面了.</h2>
- <script src="http://dl.javafx.com/1.1/dtfx.js"></script>
- <script>
- javafx(
- {
- archive: "JavaFXApplet.jar",
- draggable: true,
- width: 300,
- height: 280,
- code: "org.webbiscuit.MyJavaFXStage",
- name: "JavaFXApplet"
- }
- );
- </script>
- </body>
- </html>
//令做可拖动的纯粹的Applet还有另外一种方式的,找个时间整理了再发上来
【编辑推荐】