![]() |
|
[Java] Animated Tray Notification | Fully Customizabe | JavaFX - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Java] Animated Tray Notification | Fully Customizabe | JavaFX (/showthread.php?tid=4895711) |
Animated Tray Notification | Fully Customizabe | JavaFX - +Haze - Jul 6, 2015 Tray Notification is a class coded in JavaFX that is used to construct tray notifications which can be shown on desktop computers. The TrayNotification comes with 5 pre-loaded notification types and 3 animation types, but also allows users to create their own custom tray types. You can all freely use this in your Java and JavaFX applications :) - Just give me some credits.
Also, I want to know how to make this compatible with Swing applications and .NET applications. If anyone could help me with that then I'd appreciate it. GitHub Page https://github.com/PlusHaze/TrayNotification If you want to test by creating your own notifications as seen in the YouTube video below, download the program by going to the github link above, go to the /out folder and download TrayTester.jar... Give me your feedback, thanks :D YouTube video demonstration
Information on how to use.
To use, create an instance of TrayNotification class and define its title, message and notificationType PHP Code An alternative is to initialize the Tray Notification via the Constructors.
PHP Code This therefore produces the tray notification, as shown below.
Spoiler (Click to View) The default animation type is a sliding animation. When shownAndWait() is called, the tray notification will show and wait till it's dismissed either progrmatically or using the close button. When showAndWait() is called it produces an animated entrance which looks the gif below Spoiler (Click to View)
Using different animation and notification types
You can also set a different notification and animation type. For example, you can use a Notice notification type with a fading animation. PHP Code Spoiler (Click to View)
Creating a custom tray notification
You can set a custom image, custom rectangle fill, and we can also use a popup animation. You can also use a showAndDismiss, which will show both the show and dismiss animation. It also allows you to set a parameter which controls how long the tray should wait after the show animation to run the dismiss animation. This is great when you want notifications to show for x amount of time before closing. PHP Code
Spoiler (Click to View)
Setting a new tray overload methods
A short hand to changing the design of a tray animation is to use the setTray() overload methods as shown below. PHP Code * - JavaProfit - Jul 6, 2015 That looks very nice Haze. I can't wait to see it be used in literally every Java application on HF. I do suggest that the slide-in animation is a bit strange because it goes all the way to the center of the screen. * - Weco - Jul 6, 2015 That looks really great! Nice work you have done there. * - MrOrang - Jul 6, 2015 May I suggest notification lengths. You could have it use TimeUnit and stuff or maybe a enum like NotificationTime.NORMAL * - +Haze - Jul 6, 2015 (Jul 6, 2015 11:46 AM)Systemic Wrote: That looks very nice Haze. I can't wait to see it be used in literally every Java application on HF. Thanks bruh. I doubt much people would even use this though ahaha, the avg HF users like skiddy things like booters and crypters. Though this could be in-cooperated with a crypter or booter as a cool feature. Plus yeah I added the slide in animation because I thought it was cool, I liked the way it had this springy element to it's transition. (Jul 6, 2015 12:40 PM)Weco Wrote: That looks really great! Nice work you have done there. Thanks dude :), hope people will find use for it. (Jul 6, 2015 12:43 PM)Looka Wrote: May I suggest notification lengths. I've demonstrated that in the thread and in the video. Look at it again. tray.showAndDismiss(Duration.seconds(2)); You can then specify how long you want it to wait before it dismisses after the entrance. Though you can't delay the Show animation, only the Dismiss animation which when you think about it makes total sense. * - MrOrang - Jul 6, 2015 Oh derp must have missed that. Anyways is it also possible to put the notifications in other corners such as top left/right and stuff? * - +Haze - Jul 6, 2015 (Jul 6, 2015 12:56 PM)Looka Wrote: Oh derp must have missed that. Anyways is it also possible to put the notifications in other corners such as top left/right and stuff? It's a bit silly for a notification to show up on the top right or top left, by default the notification will appear wherever in alignment with the length of your task Taskbar. Apart from that it will always show on the bottom right. If you think the notifications could do with new existing features then feel free to fork my code from GitHub and extend them as you wish. I've commented the code so it should be somewhat easy to follow through. If you do MOD it just leave credits. * - WildeThing - Jul 6, 2015 "Also, I want to know how to make this compatible with Swing applications and .NET applications. If anyone could help me with that then I'd appreciate it." JWindow. I came across a nice example in another member's code: https://github.com/JershDervis/MonitorJ-RAT/blob/574cc0ea78463f01d85f4e2dbcbec34e09f80d9d/MonitorJ/src/me/jershdervis/monitorj/ui/components/Toaster.java As for C#, I dunno. Nice work. * - +Haze - Jul 6, 2015 (Jul 6, 2015 01:02 PM)WildeThing Wrote: "Also, I want to know how to make this compatible with Swing applications and .NET applications. If anyone could help me with that then I'd appreciate it." Oh thanks, I will look into the Jni4Net api and see if I can get it working. * - WildeThing - Jul 6, 2015 (Jul 6, 2015 01:15 PM)+Haze Wrote: Oh thanks, I will look into the Jni4Net api and see if I can get it working. I wouldn't bother using Java w/ .NET. Just write it in C#. * - +Haze - Jul 6, 2015 (Jul 6, 2015 02:08 PM)WildeThing Wrote: I wouldn't bother using Java w/ .NET. Just write it in C#. Remaking those animations in C# would be a nightmare. Especially the slide in animation. I'd rather not looool. C# doesn't have the cool JavaFX animations libs 😏 * - WildeThing - Jul 6, 2015 (Jul 6, 2015 02:15 PM)+Haze Wrote: Remaking those animations in C# would be a nightmare. Especially the slide in animation. I'd rather not looool. C# doesn't have the cool JavaFX animations libs 😏 Well yeah but if I were you I'd change your sig to say "in your JavaFX apps" since "apps" is pretty vague and I wouldn't use this with Swing or AWT. Other than that, nice one. * - +Haze - Jul 6, 2015 (Jul 6, 2015 02:22 PM)WildeThing Wrote: Well yeah but if I were you I'd change your sig to say "in your JavaFX apps" since "apps" is pretty vague and I wouldn't use this with Swing or AWT. Other than that, nice one. Thanks mate :D. I chose my words carefully 😏. I said apps to attract more people to at least look at it, you never know someone could actually gain interest in JavaFX from just looking at this thread (That's how I got into JavaFX). * - ??? - Jul 6, 2015 This looks great , I like it. * - Entire - Jul 7, 2015 Haze finally released it, and glad you made fade in a option too :D The slide in is weird but I defo see others using this alot :P |