Thursday, April 30, 2009

new Java Growl/GNTP library available

thanks to Bananeweizen, there is now a Java GNTP library available:

// connect to Growl on the given host
GrowlConnector growl = new GrowlConnector("hostname");

// give your application a name and icon (optionally)
Application downloadApp = new Application("Downloader", "");

// create reusable notification types, their names are used in the Growl settings
NotificationType downloadStarted = new NotificationType("Download started", "c:\started.png");
NotificationType downloadFinished = new NotificationType("Download finished", "c:\finished.jpg");
NotificationType[] notificationTypes = new NotificationType[] { downloadStarted, downloadFinished };

// now register the application in growl
growl.register(downloadApp, notificationTypes);

// create a notification with specific title and message
Notification ubuntuDownload = new Notification(downloadApp, downloadStarted, "Ubuntu 9.4", "654 MB");

// finally send the notification

now there is no excuse not to build Growl/GNTP support into your Java applications! =)


  1. is Java lib support Growl callback?

  2. Try to use this code with the windows growl's version.
    The compiler say :
    "Cannot access net.sf.libgrowl.GrowlConnector, bad class file: libgrowl-0.1.1.jar
    class file has wrong version 49.0, should be 48.0"

    Any idea ?

  3. Ok, my compiler was too old, no problem with the 1.6jdk.
    Everything works fine :D

  4. There is a VERY good excuse not to use that library - it's GPL (not LGPL), meaning you have to make your whole app GPL as well if you want to use it.

  5. Every pupil will be given with a gaming pin provided an educator in all the topics. kahoot cheats Which is very important in the current understanding sessions.