Jan Tennert
Jan Tennert

Reputation: 79

Notifications in JavaFX 14

I know I can create a notification with

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();

But in IntelliJ (JDK 11 and JavaFX 14) I can't find the class Notifications. How can I create a notification in JavaFX 14?

Upvotes: 0

Views: 437

Answers (1)

Steph
Steph

Reputation: 841

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

Upvotes: 1

Related Questions