}
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
if (!GraphicsEnvironment.isHeadless() && SystemTray.isSupported())
{
SystemTray systemTray = SystemTray.getSystemTray();
TrayIcon[] trayIconsToDispose = systemTray.getTrayIcons();
for (TrayIcon ti : trayIconsToDispose) {
systemTray.remove(ti);
}
}
return null;
}
});