List of usage examples for java.awt TrayIcon TrayIcon
public TrayIcon(Image image)
From source file:de.whiledo.iliasdownloader2.swing.service.MainController.java
private void minimizeToTray() { if (SystemTray.isSupported()) { trayIcon = new TrayIcon(getImage("open_alt-small.png").getImage()); trayIcon.addMouseListener(new MouseAdapter() { @Override/* w w w .j a v a2 s .c o m*/ public void mouseClicked(MouseEvent e) { trayIconClicked(); } }); trayIcon.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { trayIconClicked(); } }); // trayIcon.setPopupMenu(popup); trayIcon.setToolTip(APP_NAME); try { SystemTray.getSystemTray().add(trayIcon); mainFrame.setVisible(false); } catch (AWTException e1) { throw new RuntimeException(e1); } } }