public class TrayIcon
extends java.awt.Component
You can register TrayIcon listeners for receiving mouse events (WM_MOUSEMOVE, WM_LBUTTONDOWN etc.)
Modifier and Type | Field and Description |
---|---|
static int |
WM_RESTORE_TRAY |
static int |
WM_TRAY |
Constructor and Description |
---|
TrayIcon() |
TrayIcon(Icon icon)
Creates an instance of TrayIcon with a specified icon.
|
Modifier and Type | Method and Description |
---|---|
void |
addTrayListener(BalloonListener listener)
Adds a balloon events listener for the specified tray icon.
|
void |
addTrayListener(java.awt.event.MouseListener listener)
Adds a standard mouse listener for the tray icon.
|
void |
addTrayListener(TrayIconListener listener)
Adds a specified tray icon listener.
|
void |
dispose()
Disposes a tray icon.
|
javax.swing.JPopupMenu |
getPopupMenu()
Returns the set popup menu for the tray icon or null if it is not present.
|
void |
removePopupMenu()
Removes the tray icon popup menu.
|
void |
removeTrayListener(BalloonListener listener)
Removes specified balloon events listener.
|
void |
removeTrayListener(java.awt.event.MouseListener listener)
Removes specified mouse listener.
|
void |
removeTrayListener(TrayIconListener listener)
Removes a specified listener.
|
void |
setIcon(Icon icon)
Sets an icon in the system tray.
|
void |
setPopupMenu(javax.swing.JPopupMenu popupMenu)
Sets up a popup menu for the tray icon.
|
void |
setToolTip(java.lang.String tip)
Sets up a tooltip for the tray icon.
|
void |
setVisible(boolean visible)
Shows or hides an icon in the system tray.
|
void |
showMessage(TrayMessage value)
Sets and shows a balloon message.
|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
public static final int WM_TRAY
public static final int WM_RESTORE_TRAY
public TrayIcon()
public TrayIcon(Icon icon)
icon
- public void setIcon(Icon icon)
icon
- public void showMessage(TrayMessage value)
value
- is a container of the ballon message attributes.public void dispose()
public void setToolTip(java.lang.String tip)
tip
- is a message to be shown in the tooltip.public void setPopupMenu(javax.swing.JPopupMenu popupMenu)
popupMenu
- the popup menu to be set up.public javax.swing.JPopupMenu getPopupMenu()
public void removePopupMenu()
public void addTrayListener(TrayIconListener listener)
listener
- public void addTrayListener(java.awt.event.MouseListener listener)
listener
- public void addTrayListener(BalloonListener listener)
listener
- public void removeTrayListener(TrayIconListener listener)
listener
- public void removeTrayListener(java.awt.event.MouseListener listener)
listener
- public void removeTrayListener(BalloonListener listener)
listener
- public void setVisible(boolean visible)
setVisible
in class java.awt.Component
visible
-