Using the latest java (1.6) we finally have access to the system tray and can install icons there. My application runs as a service and can interact with the desktop (Java service wrapper property set to allow this). When the user logs off, the system tray is removed as normal, but when the user logs back on the icon does not reappear.
The desired behaviour is clearly to have the icon reappear if the Java application has not explicitly removed it.
In fact there is no API call that I can find which determines whether the Icon is actually showing or not, so the workaround to remove and add the icon again is less than satisfactory. Continually removing/adding the icon makes the icon flash in and out in the tray which is not ideal.
I submitted this as a bug to the Sun 1.6 team, and they have written back to ask me to submit this bug to you instead.
Looking into the windows API I can see that there are events which are issued to tray icons to notify that the user has logged on - I guess its one of those things which needs someone to assess it more precisely and it may not be your problem. If you can confirm this I can then go back to the Sun team.
Thanks in advance.
Logged In: YES
user_id=228081
Originator: NO
Can you please create a simple example program which demonstrates this. I would be happy to take a look at it, but it would be helpful if I didn't have to do it from scratch.
It sounds like something needs to be catching the login event and redisplaying the icon. This is not an event that is normally possible with Java applications as they can not be run as a service.
Cheers,
Leif
Logged In: NO
We use another approach for this. Instead of letting a service wrapper handle the trayicons, you could catch the events that come from the JSW when a user logs on or off and handle the trayicon yourself.
I don't think this is a "bug"
Regards,
Sebastian Kopsan