|  | 
		
| Java Example Program/ Sample Source Code 
| import java.awt.AWTException; import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.Graphics;
 import java.awt.MenuItem;
 import java.awt.PopupMenu;
 import java.awt.SystemTray;
 import java.awt.TrayIcon;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 import java.awt.event.MouseMotionAdapter;
 import java.awt.event.MouseMotionListener;
 import java.awt.image.BufferedImage;
 
 public class RemoveActionListener_TrayIcon {
 public static void main(String[] a) {
 if (SystemTray.isSupported()) {
 
 final SystemTray tray = SystemTray.getSystemTray();
 
 Dimension size = tray.getTrayIconSize();
 BufferedImage bi = new BufferedImage(size.width, size.height,
 BufferedImage.TYPE_INT_RGB);
 Graphics g = bi.getGraphics();
 g.setColor(Color.blue);
 g.fillRect(0, 0, size.width, size.height);
 final TrayIcon trayIcon = new TrayIcon(bi);
 
 trayIcon.getActionCommand();
 trayIcon.getActionListeners();
 trayIcon.getImage();
 trayIcon.getMouseListeners();
 trayIcon.getMouseMotionListeners();
 trayIcon.getPopupMenu();
 trayIcon.getSize();
 trayIcon.getToolTip();
 trayIcon.isImageAutoSize();
 trayIcon.setActionCommand("setActionCommand");
 trayIcon.setImage(bi);
 trayIcon.setImageAutoSize(true);
 trayIcon.setPopupMenu(new PopupMainMenu());
 trayIcon.setToolTip("setToolTip");
 
 trayIcon.addActionListener(new MyActionListener());
 trayIcon.removeActionListener(new MyActionListener());
 
 trayIcon.addMouseListener(new MyMouseListener());
 trayIcon.removeMouseListener(new MyMouseListener());
 
 trayIcon.addMouseMotionListener(new MyMouseMotionListener());
 trayIcon.removeMouseMotionListener(new MyMouseMotionListener());
 
 
 
 trayIcon.addActionListener(new ActionListener() {
 public void actionPerformed(ActionEvent e) {
 System.out.println("Tray Icon Clicked");
 trayIcon.displayMessage("Clicked!","Some action performed", TrayIcon.MessageType.INFO);
 try {
 Thread.sleep(1000);
 } catch (InterruptedException ie) {
 ie.printStackTrace();
 }
 tray.remove(trayIcon);
 }
 });
 
 
 try {
 tray.add(trayIcon);
 } catch (AWTException e) {
 System.err.println("TrayIcon could not be added.");
 }
 }
 }
 }
 class PopupMainMenu extends PopupMenu {
 public PopupMainMenu() {
 super("File");
 MenuItem menuitem;
 add(menuitem = new MenuItem("Copy"));
 add(menuitem = new MenuItem("Open"));
 add(menuitem = new MenuItem("Cut"));
 add(menuitem = new MenuItem("Paste"));
 }
 }
 
 class MyActionListener implements ActionListener {
 public void actionPerformed(ActionEvent event) {
 String choice = event.getActionCommand();
 System.out.println("actionPerformed "+choice);
 }
 }
 class MyMouseListener extends MouseAdapter {
 
 @Override
 public void mouseClicked(MouseEvent e) {
 System.out.println("mouseClicked ");
 
 }
 }
 
 class MyMouseMotionListener extends MouseMotionAdapter {
 
 @Override
 public void mouseMoved(MouseEvent e) {
 System.out.println("mouseMoved ");
 
 }
 }
 |  |  |  
| 
| 
AWTEventMulticaster
How To Use AWTEventMulticasteradd(ActionListener a, ActionListener b) In AWTEventMulticasteradd(AdjustmentListener a, AdjustmentListener b) In AWTEventMulticasteradd(ComponentListener a, ComponentListener b) In AWTEventMulticasteradd(ContainerListener a, ContainerListener b) In AWTEventMulticasteradd(FocusListener a, FocusListener b) In AWTEventMulticasteradd(HierarchyBoundsListener a, HierarchyBoundsListener b) In AWTEventMulticasteradd(HierarchyListener a, HierarchyListener b) In AWTEventMulticasteradd(InputMethodListener a, InputMethodListener b) In AWTEventMulticasteradd(ItemListener a, ItemListener b) In AWTEventMulticasteradd(KeyListener a, KeyListener b) In AWTEventMulticasteradd(MouseListener a, MouseListener b) In AWTEventMulticasteradd(MouseMotionListener a, MouseMotionListener b) In AWTEventMulticasteradd(MouseWheelListener a, MouseWheelListener b) In AWTEventMulticasteradd(TextListener a, TextListener b)  In AWTEventMulticasteradd(WindowFocusListener a, WindowFocusListener b) In AWTEventMulticasteradd(WindowListener a, WindowListener b) In AWTEventMulticasteradd(WindowStateListener a, WindowStateListener b) In AWTEventMulticasteraddInternal(EventListener a, EventListener b) In AWTEventMulticasterremove(ActionListener l, ActionListener oldl) In AWTEventMulticasterremove(AdjustmentListener l, AdjustmentListener oldl) In AWTEventMulticasterremove(ComponentListener l, ComponentListener oldl) In AWTEventMulticasterremove(ContainerListener l, ContainerListener oldl) In AWTEventMulticasterremove(EventListener oldl) In AWTEventMulticasterremove(FocusListener l, FocusListener oldl) In AWTEventMulticasterremove(HierarchyBoundsListener l, HierarchyBoundsListener oldl) In AWTEventMulticasterremove(HierarchyListener l, HierarchyListener oldl) In AWTEventMulticasterremove(InputMethodListener l, InputMethodListener oldl) In AWTEventMulticasterremove(ItemListener l, ItemListener oldl) In AWTEventMulticasterremove(KeyListener l, KeyListener oldl) In AWTEventMulticasterremove(MouseListener l, MouseListener oldl) In AWTEventMulticasterremove(MouseMotionListener l, MouseMotionListener oldl) In AWTEventMulticasterremove(MouseWheelListener l, MouseWheelListener oldl) In AWTEventMulticasterremove(TextListener l, TextListener oldl)  In AWTEventMulticasterremove(WindowFocusListener l, WindowFocusListener oldl) In AWTEventMulticasterremove(WindowListener l, WindowListener oldl) In AWTEventMulticasterremove(WindowStateListener l, WindowStateListener oldl) In AWTEventMulticasterremoveInternal(EventListener l, EventListener oldl) In AWTEventMulticastersave(ObjectOutputStream s, String k, EventListener l)  In AWTEventMulticastersaveInternal(ObjectOutputStream s, String k)  In AWTEventMulticaster 
DefaultFocusTraversalPolicy 
DefaultKeyboardFocusManager 
Graphics
clipRect(int x, int y, int width, int height) In GraphicsdrawArc(int x, int y, int width, int height, int startAngle, int arcAngle) In GraphicsdrawLine(int x1, int y1, int x2, int y2) In GraphicsdrawOval(int x, int y, int width, int height) In GraphicsdrawPolygon(int[] xPoints, int[] yPoints, int nPoints) In GraphicsdrawRect(int x, int y, int width, int height) In GraphicsdrawString(String str, int x, int y) In GraphicsfillArc(int x, int y, int width, int height, int startAngle, int arcAngle) In GraphicsfillOval(int x, int y, int width, int height) In GraphicsfillPolygon(int[] xPoints, int[] yPoints, int nPoints) In GraphicsfillRect(int x, int y, int width, int height) In GraphicsdrawImage(Image img, int x, int y, ImageObserver observer) In GraphicssetColor(Java.awt.Color) In GraphicssetPaintMode() In GraphicssetXORMode(Java.awt.Color) In GraphicssetFont(Java.awt.Font) In Graphics 
GraphicsConfiguration
Using GraphicsConfigurationcreateCompatibleImage(int width, int height) In GraphicsConfigurationcreateCompatibleImage(int width, int height, int transparency) In GraphicsConfigurationcreateCompatibleVolatileImage(int width, int height) In GraphicsConfigurationcreateCompatibleVolatileImage(int width, int height, ImageCapabilities caps) In GraphicsConfigurationcreateCompatibleVolatileImage(int width, int height, ImageCapabilities caps, int transparency) In GraphicsConfigurationcreateCompatibleVolatileImage(int width, int height, int transparency) In GraphicsConfigurationgetBounds() In GraphicsConfigurationgetBufferCapabilities() In GraphicsConfigurationgetColorModel() In GraphicsConfigurationgetColorModel(int transparency) In GraphicsConfigurationgetDefaultTransform() In GraphicsConfigurationgetDevice() In GraphicsConfigurationgetImageCapabilities() In GraphicsConfigurationgetNormalizingTransform() In GraphicsConfigurationisTranslucencyCapable() In GraphicsConfiguration 
MediaTracker
How To Use MediaTrackeraddImage(Image image, int id) In MediaTrackeraddImage(Image image, int id, int w, int h) In MediaTrackercheckAll() In MediaTrackercheckAll(boolean load) In MediaTrackercheckID(int id) In MediaTrackercheckID(int id, boolean load) In MediaTrackergetErrorsAny() In MediaTrackergetErrorsID(int id) In MediaTrackerisErrorAny() In MediaTrackerisErrorID(int id) In MediaTrackerremoveImage(Image image) In MediaTrackerremoveImage(Image image, int id) In MediaTrackerremoveImage(Image image, int id, int width, int height) In MediaTrackerstatusAll(boolean load) In MediaTrackerstatusID(int id, boolean load) In MediaTrackerwaitForAll() In MediaTrackerwaitForAll(long ms) In MediaTrackerwaitForID(int id) In MediaTrackerwaitForID(int id, long ms) In MediaTracker | 
 |  |  |  |