Method setImage() is used to show the changed status of an application in your program. Its syntax is as following: trayIcon.setImage(updatedImage);Tooltip can be obtained or set for Traylcon. When mouse is at Traylcon, it will be shown. For an operating system, it gets displayed that is dependent at the time period.trayIcon.setTooltip("I'm busy. Go away.");For Traylcon, auto size property is present. Image is fitted as well as auto sized by it. By default, it’s set to false.
One or more than one instances could be added of java.awt.TrayIcon to the System Tray. Removal or addition methods are used to add/remove the Traylcons. Presentation of tray icon is basically the Traylcon which can be removed or added, from any SystemTray. The functionality of the Traylcon is more as compared to what has been shown in tray. Following can be present in it. AWT “popup menu”Set of listeners associatedText tooltip
Many MouseEvenets are generated
System tray could be accessed by the Java. In Java, class java.awt.SystemTray presents the system tray, for desktop. The static method SystemTray.getSystemTray() calls the operating system’s System tray.
SystemTray.isSupported() is used for checking whether it provides support, before its access. It throws java.land.UnsupportedOperationException in case if it doesn’t support or is not checked for support. Just one SystemTray’s instance is present in Java application.SystemTray’s
At desktop’s bottom, a specific area named as “the system tray” exists. Operating system user always has the access to this area.
1. Referred as system tray in KDE.
2. In windows, it is also known as Taskbar Status area.
3. It is known as notification area in case of a Gnome desktop.
This area is accessed as well as shared all times in any operating system, by all applications.
The given figure illustrates the system tray at Linux as well as MS
Since Java SE 6, programmers can add an icon for their applications in the system tray area of the operating system. A common usage scenario of the system tray is having a popup menu showing when users right click on the icon. The popup menu presents to users with common tasks that the application provides. When users double click on the icon, they will access the default action of the program. The screenshot below depicts a tray icon and popup menu of an application in the Taskbar notification
Updated 12-09-2011 at 03:38 PM by Java AWT