Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I render nice desktop notifications from Java? [closed]

I am writing this very basic J2SE application which alerts the user with some info every now and then. Currently I am using the SystemTray and TrayIcon classes to show notifications, but I am not really pleased with that. It does not allow me to tweak the notifications, nor gives them a good look.

So, does anyone know an easy to use library to generate nice notifications?

btw, I will be porting to Linux (Ubuntu) to, but will be using notify-OSD there, which is exactly what I need.

like image 546
W. Goeman Avatar asked Jun 27 '11 21:06

W. Goeman


1 Answers

I' not aware of a Java library abstracting all OS specific desktop notifications. But if you know, you are limited to Ubuntu (and perhaps a limited number of other OS), you can create a own Interface and implement it for the specific OS.

  • Ubuntu: You can access /usr/bin/notify-send via Runtime like this: usr/bin/notify-send -t 30000 "Text1" "Text2" -i /path/to/48x48.png
  • Mac OSX: Java Growl API

For JAVA implementations you may look at Jazz or Mylyn (see Java Desktop Notifications).

like image 70
Thor Avatar answered Sep 27 '22 17:09

Thor