Skip to main content

[Fwd: What about Tray/DockIcon support?]

1 reply [Last post]
Anonymous

Bino,

there is considerable interest for application icon support in JDIC
(forum copied). Do you want to put up your prototype as a contributor
project as a starting point for the design?

Thorsten

-------- Original Message --------
Subject: What about Tray/DockIcon support?
Date: Tue, 08 Jun 2004 09:39:36 -0400 (EDT)
From: jdic@javadesktop.org
Reply-To: jdic@jdic.dev.java.net
To: jdic@jdic.dev.java.net

Hi all.

What I'd really like to have is an abstraction of the various
"application icon" systems like the TrayIcon on Windows and the DockIcon
on Mac OS X.

I suggest this because they have a lot in common on all operating
systems (notification, (dynamic) icon, popup-menu).

This project seems to be the right place for such an API since it would
deepen the desktop integration of JavaApps.

There are projects like
http://jeans.studentenweb.org/java/trayicon/trayicon.html
or
http://www.amug.org/~glguerin/sw/ (Notifications for Java)
that provide some of the functionalities I'm looking for but I think the
use of various different API's that implement nearly the same features
for different operating systems hinders wide-spread use in general.

Yours,
J�rn Huxhorn
---
[Message sent by forum member 'jhuxhorn' (Joern Huxhorn)]

http://www.javadesktop.org/forums/thread.jspa?messageID=11423&#11423

---------------------------------------------------------------------
To unsubscribe, e-mail: jdic-unsubscribe@jdic.dev.java.net
For additional commands, e-mail: jdic-help@jdic.dev.java.net

--
Thorsten Laux
Desktop Java Strategist
Sun Microsystems

---------------------------------------------------------------------
To unsubscribe, e-mail: jdic-unsubscribe@jdic.dev.java.net
For additional commands, e-mail: jdic-help@jdic.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bino_george
Offline
Joined: 2003-06-16
Points: 0

Hi Thorsten,
Yes I will put up the prototype as a starting point.
I had originally done this with the tray code added to JDIC in place,
but since then George has asked me to remove the TRAY code and put
it out as a standalone project. I needed some time to remove the JDIC
dependancy and test it all again. So I plan to put this out on the
incubator area as George suggested.

The approach I took was to use the System notification tray protocol
for both Gnome and KDE http://www.freedesktop.org/Standards/systemtray-spec
and windows Shell API for windows.

My prototype works on both linux (Gnome,KDE) and Windows. Tray Menus
are Swing Menus so that they can take on a Standard L&F and also
you can use the System L&F. In addition my API supports Animated
Icons as well. All you need to do get animation in the notification tray
is t use an animated GIF. Since the menus are Swing menus they can
have Icons in the menus as well (unlike Windows and Gnome tray menus.)
Also you get seemless integration with the rest of your Java GUI app.

Here is an example of how to use the API :

SystemTray tray = SystemTray.getDefaultSystemTray();
JPopupMenu menu;
.
.
// define JMenu

ImageIcon i = new ImageIcon("b1.gif");

TrayIcon ti = new TrayIcon(i,"Java System Tray Demo",menu);

ti.setIconAutoSize(true);
ti.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(null, "System Tray Demo", "About",
+JOptionPane
.INFORMATION_MESSAGE);
}
});

tray.addTrayIcon(ti);

It is that simple, the tray API takes care of talking to the desktop and
doing all the native protocols, showing the tooltips, popping up menu on
right click etc.

Hopefully, I should be able to submit this in next couple of weeks.

Thanks,
Bino.

On Tue Jun08 15:48:36, Thorsten Laux wrote:
> Bino,
>
> there is considerable interest for application icon support in JDIC
> (forum copied). Do you want to put up your prototype as a contributor
> project as a starting point for the design?
>
> Thorsten
>