Download the latest version of Growl for Windows

Growl On Your Phone

Get your Growl notifications on your phone with these apps:

WP7
Android
Notify My Android
iPhone
iPhone

For Developers

Integrate Growl notifications into your applications with just a few lines of code

Download the Integration Guide >

Create custom displays for handling notifications

Download the Display SDK >

Thursday, April 30, 2009

new Java Growl/GNTP library available

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

https://sourceforge.net/projects/libgrowl/


// 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", "http://example.com/icon.png");

// 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
growl.notify(ubuntuDownload);


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

4 comments:

  1. is Java lib support Growl callback?

    ReplyDelete
  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 ?

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

    ReplyDelete
  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.

    ReplyDelete