新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
使用JavaFx創(chuàng)建可拖動的Applet示例
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代碼
- http-equiv="Content-Type" content="text/html; charset=gb2312">
JavaFXApplet - 按住 Alt 鍵,然后拖動鼠標就可以把Applet拉到桌面了.
- http-equiv="Content-Type" content="text/html; charset=gb2312">
JavaFXApplet - 按住 Alt 鍵,然后拖動鼠標就可以把Applet拉到桌面了.
//令做可拖動的純粹的Applet還有另外一種方式的,找個時間整理了再發(fā)上來
本文標題:使用JavaFx創(chuàng)建可拖動的Applet示例
路徑分享:http://www.5511xx.com/article/cdjhooo.html


咨詢
建站咨詢
