banner

Desktop Integration

Optional Reading

We will be using the Creating a GUI with JFC/Swing tutorial from Sun as a Reference source. You are not required to read the entire tutorial, I suggest you skim through it though to use a a supplement to what I give you here.

Desktop Integration

In Java SE version 6 (JDK 1.6), Sun included some desktop integration features that haven't been seen in Java before. Supported operations include:

In addition The SystemTray class represents the system tray for a desktop. On Microsoft Windows it is referred to as the "Taskbar Status Area", on Gnome it is referred to as the "Notification Area", on KDE it is referred to as the "System Tray". The system tray is shared by all applications running on the desktop. On some platforms the system tray may not be present or may not be supported, in this case getSystemTray() throws UnsupportedOperationException.

The SystemTray may contain one or more TrayIcons, which are added to the tray using the add(TrayIcon) method, and removed when no longer needed, using the remove(TrayIcon). TrayIcon consists of an image, a popup menu and a set of associated listeners. Please see the TrayIcon class for details. Every Java application has a single SystemTray instance that allows the app to interface with the system tray of the desktop while the app is running. The SystemTray instance can be obtained from the getSystemTray() method. An application may not create its own instance of SystemTray.

SystemTray instance can be obtained from the getSystemTray() method. An application may not create its own instance of SystemTray.