GeezerVison is showing docs.oracle.com — TrayIcon (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
-
-
Nested Class Summary
Nested Classes
| Modifier and Type |
Class |
Description |
static class |
TrayIcon.MessageType |
The message type determines which icon will be displayed in the
caption of the message, and a possible system sound a message
may generate upon showing.
|
-
Constructor Summary
Constructors
| Constructor |
Description |
TrayIcon(Image image) |
Creates a TrayIcon with the specified image.
|
TrayIcon(Image image,
String tooltip) |
Creates a TrayIcon with the specified image and
tooltip text.
|
TrayIcon(Image image,
String tooltip,
PopupMenu popup) |
Creates a TrayIcon with the specified image,
tooltip and popup menu.
|
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
TrayIcon
public TrayIcon(Image image,
String tooltip,
PopupMenu popup)
Creates a TrayIcon with the specified image,
tooltip and popup menu.
- Parameters:
image - the Image to be used
tooltip - the string to be used as tooltip text; if the
value is null no tooltip is shown
popup - the menu to be used for the tray icon's popup
menu; if the value is null no popup menu is shown
- Throws:
IllegalArgumentException - if image is null
UnsupportedOperationException - if the system tray isn't
supported by the current platform
HeadlessException - if
GraphicsEnvironment.isHeadless() returns true
SecurityException - if accessSystemTray permission
is not granted
- See Also:
SystemTray.add(TrayIcon),
TrayIcon(Image, String),
TrayIcon(Image),
PopupMenu,
MouseListener,
addMouseListener(MouseListener),
SecurityManager.checkPermission(java.security.Permission),
AWTPermission
-
Method Detail
-
setToolTip
public void setToolTip(String tooltip)
Sets the tooltip string for this TrayIcon. The
tooltip is displayed automatically when the mouse hovers over
the icon. Setting the tooltip to null removes any
tooltip text.
When displayed, the tooltip string may be truncated on some platforms;
the number of characters that may be displayed is platform-dependent.
- Parameters:
tooltip - the string for the tooltip; if the value is
null no tooltip is shown
- See Also:
getToolTip()
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|