什么是JavaFX,FXML和Scene Builder? [英] What are JavaFX, FXML and Scene Builder?

查看:166
本文介绍了什么是JavaFX,FXML和Scene Builder?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是JavaFX的新手,正在尝试在其中做一个项目.在一些教程中,他们提到了FXML.两者有什么区别?

I am new to JavaFX, and am trying to do a project in it. In some tutorials they mention FXML. What is the difference between the two?

我正在使用NetBeans IDE来开发我的项目,并且听说过在使用FXML时使用Scene Builder.场景生成器到底是什么?我应该使用JavaFX,FXML和Scene Builder顺利开发项目吗?

I am using NetBeans IDE to develop my project, and heard about using Scene Builder when working with FXML. What exactly is Scene Builder? Should I use JavaFX, FXML and Scene Builder to develop my project smoothly?

请以简单语言回答以上问题.如果可能的话,请向我提供一些有关如何使用JavaFX的很好的教程.

Please answer the above questions in simple language. If possible, provide me some good tutorials on how to use JavaFX.

推荐答案

将JavaFX看作一堆软件包,可以使它们创建丰富的Internet和桌面应用程序.
如果您知道Swing或AWT,那么您就会知道它们用于创建GUI应用程序. JavaFX还允许您创建GUI应用程序,但只需较少的编程,并且可以使用更多的视觉效果.

Think of JavaFX as a bunch of packages which allows one to create rich internet and desktop applications.
If you know Swing or AWT, then you know that they are used to create GUI applications. JavaFX also allows you to create GUI applications, but with less programming, and with more visual effects at your disposal.

FXML是JavaFX用于创建屏幕布局的文件格式,尽管您甚至可以直接编写用户界面代码.尽管使用SceneBuilder创建FXML文件更加容易.

FXML is a file format which JavaFX uses to create the layout of screens, though you can even code your user interface directly. Although its much more easy to create FXML files using SceneBuilder.

SceneBuilder是一个应用程序,您可以在其中拖放JavaFX UI组件,然后告诉JavaFX程序使用fxml文件显示用户界面.

SceneBuilder is an application where you can drag and drop JavaFX UI components, and then tell your JavaFX program to use the fxml file(s) to display the user interface.

这是一个不错的教程:学习JavaFX 而且,您可以通过以下链接查看基于JavaOne 2013 JavaFX的视频: JavaOne 2013上的JavaFX .

Here's a nice tutorial: Learn JavaFX And you can check out the JavaOne 2013 JavaFX based videos from the following link: JavaFX at JavaOne 2013.

基于JavaFX的Oracle官方教程.这些教程涵盖FXML,SceneBuilder,CSS和许多其他主题.在使用NetBeans时,使用Oracle教程应该很简单,因为它们都随NetBeans项目一起提供(只需在每个教程页面右侧的列中查找项目zip文件).

Official Oracle Tutorials on JavaFX are highly recommended. These tutorials cover FXML, SceneBuilder, CSS and many other topics. As you are using NetBeans, using the Oracle tutorials should be straightforward as they all ship with NetBeans projects (just look for the project zip files in the columns on the right of each tutorial page).

我建议您下载JDK 8并使用JavaFX 8,并在JavaFX应用程序中使用Java 8的新功能,例如Lambda Expressions等,以使代码紧凑简洁.

I would suggest that you download JDK 8 and use JavaFX 8, and use the new capabilities of Java 8 in your JavaFX application like Lambda Expressions, etc to make your code compact and clean.

这篇关于什么是JavaFX,FXML和Scene Builder?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆