Table of Contents
I. Introduction to JavaFx
1. JavaFx Introduction
2. Usability
3. Main Features
4. UI Controls
II. Overview of JavaFx
1. JavaFx Structure Diagram
2. JavaFx Components
(1) Stage
(2) Scene
① Scene Diagram
② Node
(3) Controls
(4) Layout
(5) Charts
(6) 2D graphics
(7) 3D graphics
(8) Sound
(9) Video
III. JavaFx Quick Start
1. IDEA configures the JavaFx environment
2. Coding and running
IV. Component function introduction
1. Application
2. Stage (window)
(1) Create a stage
(2) Display the stage
(3) Set the scene on the stage
(4) Stage title
(5) Stage position
(6) Stage width and height
(7) Stage style
(8) Stage full screen mode
(9) Stage life cycle events
(10) Keyboard or mouse events
3. Scene
(1) Create a scene
(2) Set the scene on the stage
(3) Scene mouse cursor
4. Node Common properties of UI controls
(1) Control node coordinate system
(2) Set control coordinates
(3) Set control style
(4) Set the primary background width and height of the control
(5) Set text centering
(6) Set whether to show/hide the control
(7) Set the control translucency value
(8) Set the control rotation angle
(9) Set the control X-axis and Y-axis translation
5. Property binding and property monitoring of UI controls
6. Event-driven programming in JavaFx applications
7. Color, Font, Image
(1) Color
(2) Font
(3) Image
V. FXML
1. Use of FXML layout files
2. Construct fxml layout files in Scene Builder
3. Initialize method in Controller
4. Operate Controller in Application
VI. JavaFx multi-threaded operation Platform.runLater
JavaFx is a new alternative to Java graphical interface technology AWT and Swing technology
Through multiple cases, we will directly take you to quickly get started with JavaFx, so that you can easily understand and learn to use it!
1. Introduction to JavaFx
1. Introduction to JavaFx
JavaFX is the next generation graphical user interface toolkit for Java. JavaFX is a set of graphics and media APIs that we can use to create and deploy rich client applications.
JavaFX allows developers to quickly build rich cross-platform applications. JavaFX supports modern GPUs with hardware-accelerated graphics.
JavaFX allows developers to combine graphics, animations, and UI controls in a single programming interface.
Chart programming languages can be used to develop Internet applications (RIA). JavaFX technology is mainly used to create Rich internet applications (RIAs). The current JavaFX includes JavaFX Script and JavaFX Mobile (an operating system running on mobile devices), and JavaFX will include more products in the future. JavaFX Script programming language (hereinafter referred to as JavaFX) is a declarative, statically typed scripting language.
JavaFX technology has a good prospect, including the ability to call Java APIs directly. Because JavaFX Script is statically typed, it also has structured code, reusability, and encapsulation, such as packages, classes, inheritance, and separate compilation and release units, which make it possible to create and manage large programs using JavaFX technology.
JavaFx official website: https://openjfx.io/
The following are some third-party development cases and application scenarios based on JavaFx: