Platinum Partner

Java6 Create Trayicon

// description of your code here





	public void initIcon()
	{
		if (SystemTray.isSupported())
		{
			SystemTray tray = SystemTray.getSystemTray();
			Image image = Toolkit.getDefaultToolkit().getImage(ICON_FILE);


			popupMenu = new PopupMenu();

			trayIcon = new TrayIcon(image, "Daniels personal quick-scripts", popupMenu);

			
			ActionListener actionListener = new ActionListener()
			{
				public void actionPerformed(ActionEvent e)
				{
//					trayIcon.displayMessage("Action Event", "An Action Event Has Been Performed!", TrayIcon.MessageType.INFO);
				}
			};

			trayIcon.setImageAutoSize(true);
			trayIcon.addActionListener(actionListener);
			trayIcon.addMouseListener(this);

			try
			{
				tray.add(trayIcon);
			} catch (AWTException e)
			{
				System.err.println("TrayIcon could not be added.");
			}

		} else
		{
			//  System Tray is not supported
			System.out.println("No system tray supported");
		}
	}



{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}