My java application currently has an icon in the system tray. When the system tray crashes, however (you can simulate this by killing explorer.exe in the taskbar), the icon disappears after the system tray returns.
When I check SystemTray.getSystemTray().getTrayIcons() for the icons in the system tray, it always shows that my TrayIcon is still in the system tray, even though after it crashes and reloads and my tray icon is longer there.
At the moment I'm removing and adding my icon once every 15 seconds or so, but is there any other way of implementing this so that it won't keep disappearing and appearing and annoying the user?