You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey this what i have done to add the click event, i added onMessageClicked() method in the TrayNotification Class in the tray folders:
public void onMessageClicked (EventHandler<? super MouseEvent> event){
rootNode.setOnMouseClicked( event );
}
How to use it :
String title = "Congratulations sir";
String message = "You've successfully created your first Tray Notification";
NotificationType notification = NotificationType.SUCCESS;
TrayNotification tray = new TrayNotification();
tray.setTitle(title);
tray.setMessage(message);
tray.setNotificationType(notification);
//tray.showAndDismiss( Duration.millis( 5000 ) );
tray.showAndWait();
tray.onMessageClicked( v->
System.out.println( "|onMessageClicked|" )
);
try it out and see if it works for you, by the way, i am using this on JDK 10, but i doubt if you will have issues with jdk versions, so I thought to mention this just in case ey, good luck.
Is it possible to set click event on notification??
The text was updated successfully, but these errors were encountered: