G.4. Tray Icons

Tray icons generally appear in your system’s system tray, taskbar status area or notification area. They typically provide quick access to applications that are executing in the background on your system. When you position the mouse over one of these icons, a tooltip appears indicating what application the icon represents. If you click the icon, a popup menu appears with options for that application.

Classes SystemTray and TrayIcon (both from package java.awt) enable you to create and manage your own tray icons in a platform independent manner. Class SystemTray provides access to the underlying platform’s system tray—the class consists of three methods:

  • static method getDefaultSystemTray returns the system tray

  • method addTrayIcon ...

Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.