# TrayNotification **Repository Path**: jinmuming/TrayNotification ## Basic Information - **Project Name**: TrayNotification - **Description**: No description available - **Primary Language**: Java - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-01 - **Last Updated**: 2025-09-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [](https://jitpack.io/#PlusHaze/TrayNotification) # Tray Notification _Tray Notification_ is a library for JavaFX that adds easy-to-use tray notifications for desktop computers. There are 5 included notifications and 3 included animations, but you're able to also add your own. ___ ### Creating a new tray notification
To use, create an instance of TrayNotification and define its title, message and notification.
Alternatively you can initialize the tray notification with its non-default constructors.
```java TrayNotification tray = new TrayNotification(title, message, notification); tray.showAndWait(); ```
The default animation is a sliding animation. When shownAndWait() is called, the tray notification will show and wait until it is either dismissed with the close button or programmatically through your code.
You can also individually customize notifications and animations.
Using a notice notification with a fading animation, for example:
You're also able to set a custom image or rectangle fill. You can use showAndDismiss, which will show both the show and dismiss animation. You're also able to control the delay before dismissal following the show animation. This is useful for when you want a notification to appear for a certain amount of time before closing.
```java Image whatsAppImg = new Image("https://cdn4.iconfinder.com/data/icons/iconsimple-logotypes/512/whatsapp-128.png"); tray.setTitle("New WhatsApp Message"); tray.setMessage("Github - I like your new notification release. Nice one."); tray.setRectangleFill(Paint.valueOf("#2A9A84")); tray.setAnimation(Animations.POPUP); tray.setImage(whatsAppImg); tray.showAndDismiss(Duration.seconds(2)); ```
A shorthand to changing the design of a tray animation is to use the setTray's overloaded methods.
```java tray.setTray("Title", "Message", Notifications.ERROR); tray.showAndWait(); //OR tray.setTray("Title", "Message", whatsAppImg, Paint.valueOf("#2A9A84") , Animations.POPUP); tray.showAndDismiss(Duration.seconds(10)); ``` ___ ### YouTube video demonstration
The video below showcases the TrayTester.jar app
which you can get here.
Click the image below to watch the YouTube video.