新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
使用JavaFx創(chuàng)建可拖動(dòng)的Applet示例
JavaFx運(yùn)行時(shí)的下載地址:
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,這是一個(gè) JavaFx + 可拖動(dòng)Applet\n+ GAE 的應(yīng)用! 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,這是一個(gè) JavaFx + 可拖動(dòng)Applet\n+ GAE 的應(yīng)用! It's very cool!!"
- },
- ImageView { image: Image { url: "{__DIR__}GAE_java.png" } }
- ]
- }
- }
部署的html文件如下,內(nèi)嵌了JavaFx的Applet.
Html代碼
- http-equiv="Content-Type" content="text/html; charset=gb2312">
JavaFXApplet - 按住 Alt 鍵,然后拖動(dòng)鼠標(biāo)就可以把Applet拉到桌面了.
- http-equiv="Content-Type" content="text/html; charset=gb2312">
JavaFXApplet - 按住 Alt 鍵,然后拖動(dòng)鼠標(biāo)就可以把Applet拉到桌面了.
//令做可拖動(dòng)的純粹的Applet還有另外一種方式的,找個(gè)時(shí)間整理了再發(fā)上來
網(wǎng)頁(yè)題目:使用JavaFx創(chuàng)建可拖動(dòng)的Applet示例
當(dāng)前URL:http://www.dlmjj.cn/article/cdjhooo.html


咨詢
建站咨詢
