没有合适的资源?快使用搜索试试~ 我知道了~
首页JavaFx2.0入门指南
资源详情
资源评论
资源推荐

Getting Started with JavaFX
入门(实例)
!"#
$%&'"'(&
")"$* &(&$+
& &"
$
如果你希望以 快速开发出具有丰富的用户体验的应用,那么该手册正是为你而在。该手册中实例的最终效果如
" 所示,在该实例中你将学会如何创建简单的应用,如何以简短的代码实现复杂的绘图效果。当然, 的用途远
不止这些,在掌握了该手册内容后,请您移步到 hp://www.oracle.com/technetwork/java/javafx/samples/
index.html
学习更丰富的
功能。
Figure 1 Colorful Circles Application
,-"..+-
&""&&"
&$/" "
0$/" $
如果你对 的场景图(#")变成模型很熟悉,对于你来说,本实例的这段代码将会非常简单。在本实例中,
" 是最高层的容器, 是展示内容的绘图板,该实例所实现的内容是一组节点分层树德场景图。
"'"'..'$1
'!' "
'2"''.'$

" 描绘了本实例的场景图,在该场景图中,可以看出各分支节点都是 ! 类的实例,各非分支节点(也叫叶子节
点)分别是 2" 类和 . 类的实例。
Figure 2 Colorful Circles Scene Graph
,-"..#!-
Set Up the Application
%"&""$/
!"#13,4$3" &
13,4"$$##&2&'$
你可以使用任何 开发工具来创建 应用,在该实例中将使用 13,4。动手之前,请确认你使用的
13,4 支持 $。请移步 #&2& 查看开发 $ 所需的环境要求。
#(13,4$
$ &'File'& 'New Project$
启动 13,4,打开“文件”菜单,选择“新建项目”。
$ " '+$.'1$
在“5类别下的项目中选择“+5,点击“下一步”。
6$ 1&('..''$
在 7(1& 后的输入框中将该项目命名为“..'5(可以选择项目目录),点击“完成”。
8$ *'..$('9 && &(
"&&13,4"$
项目创建后将自动生成一个 ..'$( 文件,本实例的代码都在该文件中,内容如下:

ColorfulCircles.java
Legal Terms and Copyright Notice
/*
* Copyright (c) 2011 Oracle and/or its affiliates.
* All rights reserved. Use is subject to license
terms.
*
* This file is available and licensed under the
following license:
*
* Redistribution and use in source and binary
forms, with or without
* modification, are permitted provided that the
following conditions
* are met:
*
* - Redistributions of source code must retain the
above copyright
* notice, this list of conditions and the
following disclaimer.
* - Redistributions in binary form must reproduce
the above copyright
* notice, this list of conditions and the
following disclaimer in
* the documentation and/or other materials
provided with the distribution.
* - Neither the name of Oracle nor the names of
its
* contributors may be used to endorse or promote
products derived
* from this software without specific prior
written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
剩余13页未读,继续阅读

















安全验证
文档复制为VIP权益,开通VIP直接复制

评论6