1

Growl 有一个网络协议来接收来自其他应用程序的通知。

jitsi 项目(又名 SIP Communicator)似乎使用了这些类型的通知,但引用了一个名为 growl4j 的库,可能是在 2009 年 Google Summer of Code 期间开发的。

但是,这个库似乎不存在了?在 google 上找到了一些与 growl4j.dev.java.net 相关的痕迹,但该站点已不存在。

知道为什么吗?

4

2 回答 2

4

以下是几个 Growl Java 库的链接:

http://code.google.com/p/jgntp/

http://sourceforge.net/projects/libgrowl/

这两者都基于新的 GNTP 协议,因此它们可以与最新版本的 Growl(来自 Mac App Store 的 1.3+)一起使用。

于 2012-01-11T17:38:50.440 回答
2

Agree with Brian, the two quoted libraries are the only ones around I think, which work with the latest growl versions.

Here is an example: http://blog.growlforwindows.com/2009/04/new-java-growlgntp-library-available.html

Simple enough:

// 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);
于 2012-09-21T08:53:40.710 回答