Windows Tray Icon - Java Implementation!
About?
Want your Java App to live in the Windows System Tray (Taskbar Notification Area)?
-
Any icon can be used. You just need a 16x16 GIF/JPG image!
-
Tooltip is displayed when the user mouses over the icon
-
ActionListener support (callback Java method when user clicks Tray Icon)
-
Popup menu support (AWT menu, Swing menu, ...)
-
Internationalization support
-
Your applications window can be hidden (removed from the task bar) until
the user clicks the Tray Icon!
-
Support for Windows XP style Balloon Messages
-
C++ source code for the native library included
-
Unicode and Internationalization support
-
Small demo app included
Screenshots
There's also a shot included using Chinese in a Swing popup menu.
Installation
-
Download the .zip file from the download
section (unzip it using WinZip or unzip from Cygwin)
-
Install it in a directory of your choice (C:\TrayIcon in this example)
-
Open a MS-DOS or Command prompt and say (Sun Java 1.2.x and above, see README
for other platforms)
cd C:\TrayIcon
javac demo\awt\TestTrayIcon.java
java demo.awt.TestTrayIcon
or:
cd C:\TrayIcon
javac demo\swing\SwingTrayIcon.java
java demo.swing.SwingTrayIcon
-
The demo source is in demo\
-
The TrayIcon main class is com\jeans\trayicon\WindowsTrayIcon.java
-
The native C++ code is in com\jeans\trayicon\c++\WindowsTrayIcon.cpp
Version info
-
1.7.1 Released 11/01/02
- Works with Java 1.4
- Bug fix for setCheck(boolean selected)
- Dependency on jvm.lib removed (thanks to Justin Chapweske)
- Includes some support for using a Swing popup menu
-
1.7.2 Released 12/17/02
- Transparency bug fix for Windows ME
- Fixed naming problem with setWindowsMessageCallback (introduced in 1.7.1)
-
1.7.3 Released 01/03/03
- Bold and disabled AWT menu item support
- Fixed bug in keepAlive()
-
1.7.4 Released 01/08/03
- setAlwaysOnTop implemented for Swing menu (thanks to Mike Hicks)
- SwingTrayIcon demo updated with nice Swing menu
-
1.7.5 Released 02/20/03
- Support for MouseListeners (icon can respond to double clicks)
- TrayIcons are not lost anymore when Explorer crashes ;-) (thanks to Laurent Hauben)
- JAWT is only used if Swing Menu is used
-
1.7.6 Released 08/17/03
- Support for Balloon Messages
- Bug in Swing menu fixed
-
1.7.7 Released 10/23/03
- Unicode support for native components
-
1.7.8 Released 11/2/03
-
1.7.8b Released 11/26/03
- Fixed bug in Balloon message that caused VM to crash
- Fixed bug in Balloon message specific to Windows 2000
-
1.7.8c Released 01/12/04
- Swing menu is now set Always-On-Top
Hard & Soft?
-
This software was tested on platform:
-
MS Windows 95B, 98, ME, 2K, NT4, XP
-
Sun's Java 1.2, 1.3, 1.4
-
Sun's JDK/JRE 1.1.8
-
If something does not work, don't hesitate to mail me (jan.struyf@cs.kuleuven.ac.be)
See also: README
Downloads
Version 1.7.6 adds significant improvements for the Swing menu. For an example, take a look at this.
If you don't like TrayIcon for some reason, look at JTray.