Guten Morgen!
Ich bin Azubi zum FIAE und arbeite gerade an einem JavaFX-Projekt und bin auf ein kleines Problem gestoßen!
Vorraussetzungen:
Mein Problem:
ControlsFX bietet die Möglichkeit eine Notification auf dem Desktop "aufpoppen" zu lassen. (ControlsFX Features // JavaFX News, Demos and Insight // FX Experience)
Dies ist bei mir der Fall wenn ich in meinem TrayIcon (AWT) einen eintrag im Popupmenü klicke.
Das funktioniert soweit auch problemlos, sofern denn mindestens ein JavaFX Fenster geöffnet ist. Allerdings benötige ich die Popups grade dann wenn das Fenster nicht offen ist. Hat da jemand eine Idee wie ich das Regeln kann?
Aufruf des Popups
Stacktrace
Ich gebe mich auch gerne mit gezielten Denkanstößen zufrieden! Immerhin will ich mir das ja am Ende auch im Kopf behalten!
Vielen dank im Vorraus!
Toriath
Ich bin Azubi zum FIAE und arbeite gerade an einem JavaFX-Projekt und bin auf ein kleines Problem gestoßen!
Vorraussetzungen:
- Javaversion: 8, JavaFX 8
- libs: ControlsFX 8.0.6
- IDE: IntelliJ
- Platform: Win 7 + 8, MacOS-X
Mein Problem:
ControlsFX bietet die Möglichkeit eine Notification auf dem Desktop "aufpoppen" zu lassen. (ControlsFX Features // JavaFX News, Demos and Insight // FX Experience)
Dies ist bei mir der Fall wenn ich in meinem TrayIcon (AWT) einen eintrag im Popupmenü klicke.
Das funktioniert soweit auch problemlos, sofern denn mindestens ein JavaFX Fenster geöffnet ist. Allerdings benötige ich die Popups grade dann wenn das Fenster nicht offen ist. Hat da jemand eine Idee wie ich das Regeln kann?
Aufruf des Popups
Java:
if (jnlpData.isPopup() && !jnlpData.getNote().isEmpty()) {
System.out.println("TEST");
Application.invokeLater(() -> {
Notifications.create()
.title("Ihre Notiz")
.text(jnlpData.getNote())
.hideAfter(Duration.INDEFINITE)
.show();
});
}
Stacktrace
Code:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Owner window must not be null
at javafx.stage.PopupWindow.validateOwnerWindow(PopupWindow.java:916)
at javafx.stage.PopupWindow.show(PopupWindow.java:412)
at org.controlsfx.control.Notifications$NotificationPopupHandler.show(Notifications.java:437)
at org.controlsfx.control.Notifications$NotificationPopupHandler.show(Notifications.java:318)
at org.controlsfx.control.Notifications.show(Notifications.java:264)
at de.adesso.cometjnlp.tray.CometJNLPMenuItem.lambda$null$0(CometJNLPMenuItem.java:50)
at de.adesso.cometjnlp.tray.CometJNLPMenuItem$$Lambda$13/727677132.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
at com.sun.glass.ui.win.WinApplication$4$1.run(WinApplication.java:112)
at java.lang.Thread.run(Thread.java:745)
Ich gebe mich auch gerne mit gezielten Denkanstößen zufrieden! Immerhin will ich mir das ja am Ende auch im Kopf behalten!
Vielen dank im Vorraus!
Toriath
Zuletzt bearbeitet: