JavaFX Fundamentals
This page was contributed by Gail C. Anderson and Paul Anderson under the UPL and is from The Definitive Guide to Modern Java Clients with JavaFX 17 graciously contributed by Apress.With the Java SDK and JavaFX installed on your system, letβs create some applications and explore the fundamentals of JavaFX. First, weβll describe the basic structure of a JavaFX application along with selected features that make JavaFX a powerful choice for modern clients. Weβll show you how to create UIs that are appealing and responsive. Weβll look at FXML, the XML-based markup language that lets you define and configure your UI. Weβll also introduce Scene Builder, a stand-alone drag-and-drop utility for designing and configuring a JavaFX UI.
To further refine or completely restyle your UI, JavaFX uses Cascading Style Sheets (CSS). Weβll show you several ways to use CSS with JavaFX.
JavaFX properties provide a powerful binding mechanism. Weβll introduce JavaFX properties and binding. Weβll show why JavaFX observables and binding help create compact code that is less error prone than bulky listeners. Weβll also explore several layout controls and show you how easy it is to incorporate animation into your UI.
Weβll finish the series with a sample application that implements a master-detail UI using JavaFX collections, an editable form, and buttons for typical database CRUD operations. This, then, is meant to give you a taste of what is possible with JavaFX and to provide the basics for exploring JavaFX even further throughout this book. Letβs begin!
-
JavaFX Application Basic Structure By Example
Explore JavaFX application components and build a simple application.
-
JavaFX Layout Controls
Let's take a tour of some common JavaFX layout controls.
-
Effects, Gradients and Animations
Learn how to apply effects, gradients, animations to nodes in your scene graph.
-
JavaFX Properties
Control nodes by manipulating their properties.
-
Using FXML
Use FXML to describe and configure your scene graph in a declarative format.
-
Putting all together
Build an example application with JavaFX.