JavaFX 14 中的通知

Notifications in JavaFX 14

我知道我可以使用

创建通知
Notifications notificationBuilder = Notifications.create()
                .title(title)
                .text(content)
                .hideAfter(Duration.seconds(31536000))
                .position(Pos.BOTTOM_RIGHT)
                .onAction(new EventHandler<ActionEvent>() {
                    @Override
                    public void handle(ActionEvent a) {
                        //
                    }
                });

        notificationBuilder.showInformation();

但在 IntelliJ 中(JDK 11 和 JavaFX 14) 我找不到 class 通知。 如何在 JavaFX 14 中创建通知?

Because it doesn't look like it's part of either one. Only matching class I could find for this code is controlsfx.bitbucket.io/org/controlsfx/control/…, which is part of the ControlsFX project. Here is the dependency for whatever build tool you are using: mvnrepository.com/artifact/org.controlsfx/controlsfx

– ajc2000