Java Reference
In-Depth Information
• Perform JavaFX animations.
• Use JavaFX multimedia capabilities to play audio and video.
In addition, our JavaFX Resource Center
http://www.deitel.com/JavaFX
contains links to online resources where you can learn more about JavaFX's capabilities.
25.7 Wrap-Up
In this chapter, we introduced JavaFX. We presented the structure of a JavaFX stage (the
application window). You learned that the stage displays a scene's scene graph, that the
scene graph is composed of nodes and that nodes consist of layouts and controls.
You designed GUIs using visual programming techniques in JavaFX Scene Builder,
which enabled you to create GUIs without writing any Java code. You arranged Label ,
ImageView , TextField , Slider and Button controls using the VBox and GridPane layout
containers. You learned how class FXMLLoader uses the FXML created in Scene Builder to
create the GUI.
You implemented a controller class to respond to user interactions with Button and
Slider controls. We showed that certain event handlers can be specified directly in FXML
from Scene Builder, but event handlers for changes to a control's property values must be
implemented directly in the controllers code. You also learned that the FXMLLoader creates
and initializes an instance of an application's controller class, initializes the controller's
instance variables that are declared with the @FXML annotation, and creates and registers
event handlers for any events specified in the FXML.
In the next chapter, you'll use additional JavaFX controls and layouts and use CSS to
style your GUI. You'll also learn more about JavaFX properties and how to use a technique
called data binding to automatically update elements in a GUI with new data.
Summary
Section 25.1 Introduction
• A graphical user interface (GUI) presents a user-friendly mechanism for interacting with an app.
A GUI (pronounced “GOO-ee”) gives an app a distinctive “look-and-feel.”
• GUIs are built from GUI components—sometimes called controls or widgets.
• Providing different apps with consistent, intuitive user-interface components gives users a sense
of familiarity with a new app, so that they can learn it more quickly and use it more productively.
• Java's GUI, graphics and multimedia API of the future is JavaFX.
Section 25.2 JavaFX Scene Builder and the NetBeans IDE
• JavaFX Scene Builder is a standalone JavaFX GUI visual layout tool that can also be used with
various IDEs.
• JavaFX Scene Builder enables you to create GUIs by dragging and dropping GUI components
from Scene Builder's library onto a design area, then modifying and styling the GUI—all with-
out writing any code.
• JavaFX Scene Builder generates FXML (FX Markup Language)—an XML vocabulary for defin-
ing and arranging JavaFX GUI controls without writing any Java code.
 
Search WWH ::




Custom Search