Lines Matching refs:TrayIcon
51 * TrayIcon TrayIcons}, which are added to the tray using the {@link
53 * {@link #remove}. <code>TrayIcon</code> consists of an
55 * the {@link TrayIcon} class for details.
68 * {@link TrayIcon} trayIcon = null;
88 * // construct a TrayIcon
89 * trayIcon = new {@link TrayIcon#TrayIcon(java.awt.Image, String, java.awt.PopupMenu) TrayIcon}(image, "Tray Demo", popup);
90 * // set the TrayIcon properties
91 * trayIcon.{@link TrayIcon#addActionListener(java.awt.event.ActionListener) addActionListener}(listener);
95 * tray.{@link SystemTray#add(TrayIcon) add}(trayIcon);
109 * trayIcon.{@link TrayIcon#setImage(java.awt.Image) setImage}(updatedImage);
116 * @see TrayIcon
125 private int currentIconID = 0; // each TrayIcon added gets a unique ID
129 private static final TrayIcon[] EMPTY_TRAY_ARRAY = new TrayIcon[0];
171 * @see #add(TrayIcon)
172 * @see TrayIcon
197 * TrayIcon#setPopupMenu(PopupMenu)}) or an action event (see
198 * {@link TrayIcon#addActionListener(ActionListener)}).
207 * <code>TrayIcon</code> it is <em>strongly recommended</em> that
234 * Adds a <code>TrayIcon</code> to the <code>SystemTray</code>.
243 * @param trayIcon the <code>TrayIcon</code> to be added
247 * a <code>TrayIcon</code> is added more than once
249 * @see #remove(TrayIcon)
251 * @see TrayIcon
254 public void add(TrayIcon trayIcon) throws AWTException {
256 throw new NullPointerException("adding null TrayIcon");
258 TrayIcon[] oldArray = null, newArray = null;
259 Vector<TrayIcon> icons = null;
262 icons = (Vector<TrayIcon>)AppContext.getAppContext().get(TrayIcon.class);
264 icons = new Vector<TrayIcon>(3);
265 AppContext.getAppContext().put(TrayIcon.class, icons);
268 throw new IllegalArgumentException("adding TrayIcon that is already added");
285 * Removes the specified <code>TrayIcon</code> from the
296 * @param trayIcon the <code>TrayIcon</code> to be removed
297 * @see #add(TrayIcon)
298 * @see TrayIcon
300 public void remove(TrayIcon trayIcon) {
304 TrayIcon[] oldArray = null, newArray = null;
307 Vector<TrayIcon> icons = (Vector<TrayIcon>)AppContext.getAppContext().get(TrayIcon.class);
308 // TrayIcon with no peer is not contained in the array.
328 * remove a <code>TrayIcon</code> from the
330 * #remove(TrayIcon)} method.
334 * @see #add(TrayIcon)
335 * @see TrayIcon
337 public TrayIcon[] getTrayIcons() {
338 Vector<TrayIcon> icons = (Vector<TrayIcon>)AppContext.getAppContext().get(TrayIcon.class);
340 return (TrayIcon[])icons.toArray(new TrayIcon[icons.size()]);
350 * method {@link TrayIcon#getSize} in the <code>TrayIcon</code> class.
353 * @see TrayIcon#setImageAutoSize(boolean)
355 * @see TrayIcon#getSize()
372 * <td>The {@code SystemTray}'s array of {@code TrayIcon} objects.