I want to show notifications to the user in my JavaFX application and chose the ControlsFX library for that purpose. However whenever I create a warning via: Notifications.create().showWarning();
, I get the following Exception:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at org.controlsfx.controls/org.controlsfx.control.Notifications$NotificationPopupHandler.getScreenBounds(Notifications.java:364)
at org.controlsfx.controls/org.controlsfx.control.Notifications$NotificationPopupHandler.show(Notifications.java:343)
at org.controlsfx.controls/org.controlsfx.control.Notifications.show(Notifications.java:305)
at org.controlsfx.controls/org.controlsfx.control.Notifications.showWarning(Notifications.java:271)
This is called when my whole application is set up and visible.
Could this be a version mismatch? I use JavaFX 12 but ControlsFX only has a version 11.
This is an abbreviated version of my pom.xml
:
<project xmlns="[...]">
[...]
<properties>
<maven.compiler.release>12</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>${maven.compiler.release}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.3</version>
<configuration>
<mainClass>eu.snik.tag.gui.Main</mainClass>
</configuration>
[...]
</plugin>
</plugins>
[...]
<dependencies>
[...]
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>12.0.1</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>12.0.1</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>12.0.1</version>
</dependency>
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>11.0.0</version>
</dependency>
</dependencies>
</project>