TrayNotification

A tray notification class in JavaFX that allows you to call beautiful looking notifications on desktop computers.

Github星跟蹤圖

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

        String title = "Congratulations sir";
        String message = "You've successfully created your first Tray Notification";
        Notification notification = Notifications.SUCCESS;
        
        TrayNotification tray = new TrayNotification();
        tray.setTitle(title);
        tray.setMessage(message);
        tray.setNotification(notification);
        tray.showAndWait();
        TrayNotification tray = new TrayNotification(title, message, notification);
        tray.showAndWait();

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.


Using different animations and notifications

        String title = "Download quota reached";
        String message = "Your download quota has been reached. Panic.";
        Notification notification = Notifications.NOTICE;
        
        tray.setTitle(title);
        tray.setMessage(message);
        tray.setNotification(notification);
        tray.setAnimation(Animations.FADE);
        tray.showAndWait();

Creating a custom tray notification

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

Setting a new tray overload methods


        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.

主要指標

概覽
名稱與所有者PlusHaze/TrayNotification
主編程語言Java
編程語言Java (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2015-07-05 22:30:41
推送於2019-01-12 15:43:47
最后一次提交2016-03-03 20:50:04
發布數0
用户参与
星數1.4k
關注者數33
派生數110
提交數54
已啟用問題?
問題數20
打開的問題數12
拉請求數3
打開的拉請求數2
關閉的拉請求數2
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?