JavaFX 15 Tutorial 33 - Warning Alert Dialog

Опубликовано: 28 Июль 2026
на канале: Ken
1,694
14

In this tutorial, I will show you how to use the Alert dialog with JavaFX 16 on Windows 10 x64. The alert types are defined as an enum AlertType. The enum constant values are: INFORMATION, WARNING, ERROR, CONFIRMATION and NONE.

The Dialog class is defined in the javafx.scene.control package. The Dialog is the base class and it has three specialized subclasses: Alert, ChoiceDialog and TextInputDialog.

VM options
--module-path "C:\Program Files\Java\javafx-sdk-16\lib"
--add-modules javafx.controls,javafx.fxml

JDK 16
JavaFX SceneBuilder 16.0.0
IntelliJ IDEA 2021.1