From 21e18da890459698708795d93eb2daa77e0369f1 Mon Sep 17 00:00:00 2001 From: nathan Date: Sat, 31 Jan 2015 01:52:27 +0100 Subject: [PATCH] Upated to have an simple example --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 5c96636..da4aa72 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,21 @@ Not all system tray icons are the same size (default is 22px), so to properly sc You might want to specify the root location of the icons used (to make it easier when specifying icons), change the value of 'SystemTray.ICON_PATH' + + +A *simple* example is as follows: + this.systemTray = SystemTray.create("Dorkbox"); + + this.systemTray.createTray("grey_icon.png"); + this.systemTray.setStatus("Not Running", "grey_icon.png"); + + this.systemTray.addMenuEntry("Quit", new SystemTrayMenuAction() { + @Override + public void onClick(SystemTray systemTray) { + systemTray.removeTray(); + // exit or something. + } + }); ``` ``` Note: This library does NOT use SWT for system-tray support, only for the purpose