JavaFX Notes

Nicholas Duchon: May 9, 2018.

Outline


Alerts

JavaFX does not work well (at all?) with the javax.swing.JDialogBox class.
Thus, the new class is javafx.scene.control.Alert.

Simple example:

String st = "The message";
Alert alert = new Alert (AlertType.INFORMATION, st, ButtonType.OK);
alert.showAndWait ();

Imports:

import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.ButtonType;

Alert types: Button Types:
CONFIRMATION
ERROR
INFORMATION
NONE
WARNING
APPLY
CANCEL
CLOSE
FINISH
NEXT
NO
OK
PREVIOUS
YES