什么是JavaFX?

什么是JavaFX? ( What Is JavaFX? )

JavaFX is designed to provide Java developers with a new lightweight, high performance graphics platform. The intention is for new applications to use JavaFX rather than Swing to build the application's graphical user interface (GUI). This does not mean that Swing is obsolete. The vast number of applications in use that have been built using Swing mean that it will be part of the Java API for a long time yet. Especially as these applications can incorporate JavaFX functionality because the two graphical APIs run side by side seamlessly.

JavaFX旨在为Java开发人员提供一个新的轻量级高性能图形平台。 目的是使新应用程序使用JavaFX而不是Swing来构建应用程序的图形用户界面 (GUI)。 这并不意味着Swing已过时。 使用Swing构建的大量正在使用的应用程序意味着,很长一段时间以来,它将成为Java API的一部分。 特别是因为这些应用程序可以合并JavaFX功能,因为两个图形API无缝并排运行。

JavaFX can be used to create graphical user interfaces for any platform (e.g., desktop, web, mobile, etc..).

JavaFX可用于为任何平台(例如,桌面,Web,移动等)创建图形用户界面。

JavaFX历史记录-v2.0之前的版本 ( JavaFX History - Before v2.0 )

Originally the focus for the JavaFX platform was mainly for rich internet applications (RIAs). There was a JavaFX scripting language intended to make the creation of a web-based interface easier. The JavaFX versions reflecting this architecture were: 

最初,JavaFX平台的重点主要是富互联网应用程序(RIA)。 JavaFX脚本语言旨在简化基于Web的界面的创建。 反映此体系结构的JavaFX版本为:

  • v1.0 released December 2008

    v1.0 2008年12月发布
  • v1.1 released February 2009

    v1.1于2009年2月发布
  • v1.2 released June 2009

    v1.2于2009年6月发布
  • v1.3 released April 2010

    v1.3于2010年4月发布

JavaFX 2.0版 ( JavaFX Version 2.0 )

In October 2011, JavaFX 2.0 was released. This signaled the end of the JavaFX scripting language and the move of the JavaFX functionality into a Java API. This meant that Java developers did not need to learn a new graphics language and instead be comfortable creating JavaFX application using normal Java syntax. The JavaFX API contains everything you would expect from a graphics platform - UI controls, animations, effects, etc..

2011年10月,发布了JavaFX 2.0。 这标志着JavaFX脚本语言的结束以及JavaFX功能向Java API的转移。 这意味着Java开发人员无需学习新的图形语言,而可以轻松地使用常规Java语法创建JavaFX应用程序。 JavaFX API包含您希望从图形平台获得的所有内容-UI控件,动画,效果等。

The main difference for developers switching from Swing to JavaFX will be getting used to how the graphical components are laid out and the new terminology. A user interface is still built using a series of layers that are contained within a scene graph. The scene graph is displayed upon a top-level container called a stage.

开发人员从Swing切换到JavaFX的主要区别是将习惯于如何布局图形组件以及使用新的术语。 仍然使用场景图中包含的一系列图层来构建用户界面。 场景图显示在称为舞台的顶级容器上。

Other notable features with JavaFX 2.0 are:

JavaFX 2.0的其他显着功能包括:

  • a new graphics engine - Prism, a hardware accelerated pipeline, is coupled with Glass, as new windowing tookit, to produce high quality graphics for JavaFX applications.

    一个新的图形引擎-硬件加速管道Prism与Glass结合使用,如新的开窗技术一样,可以为JavaFX应用程序生成高质量的图形。
  • a new declarative markup language called FXML. It is based on XML and enables developers to define a user interface for a JavaFX application.

    一种称为FXML的新的声明性标记语言。 它基于XML,使开发人员能够为JavaFX应用程序定义用户界面。
  • a new media engine for playing web multimedia content.

    用于播放Web多媒体内容的新媒体引擎。
  • a browser plug-in for loading JavaFX applets using Prism.

    一个浏览器插件,用于使用Prism加载JavaFX applet。
  • a web component for embedding web pages within a JavaFX application.

    用于将网页嵌入JavaFX应用程序中的Web组件。
  • a doclet for generating JavaFX API documentation using Javadoc

    使用Javadoc生成JavaFX API文档的doclet

There are also a number of sample Java applications that come with the SDK to show developers how to build different kinds of JavaFX applications.

SDK附带了许多示例Java应用程序,向开发人员展示了如何构建各种JavaFX应用程序。

获取JavaFX ( Getting JavaFX )

For windows users, the JavaFX SDK comes part of the Java SE JDK since Java 7 update 2. Likewise the JavaFX runtime now comes Java SE JRE. 

对于Windows用户,自Java 7更新2起,JavaFX SDK就成为Java SE JDK的一部分。同样,JavaFX运行时现在来自Java SE JRE。

As of January 2012, there is a JavaFX 2.1 developer preview available to download for Linux and Mac OS X users.

截至2012年1月,已有JavaFX 2.1开发人员预览版可供Linux和Mac OS X用户下载。

If you are interested in seeing what it takes to build a simple JavaFX application have a look at Coding a Simple Graphical User Interface - Part III and the Example JavaFX code for Building a Simple GUI Application.

如果您对构建一个简单的JavaFX应用程序需要什么感兴趣,请阅读编码一个简单的图形用户界面-第三部分和构建一个简单的GUI应用程序示例JavaFX代码

翻译自: https://www.thoughtco.com/what-is-javafx-2034192

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值