Package java.awt

Examples of java.awt.TrayIcon



            // load icon image
            try {
                Image image = ImageIO.read(SystrayListener.class.getResource("systray.png"));
                icon = new TrayIcon(image,"Apache Marmotta",popup);
                icon.setImageAutoSize(true);
                tray.add(icon);

            } catch (IOException e) {
                log.error("SYSTRAY: could not load the logo for system tray",e);
View Full Code Here


        if (!SystemTray.isSupported()) {
            Mediator.getLogger(DaemonManager.class.getName()).log(Level.INFO, "SystemTray is not supported");
            return;
        }
        final PopupMenu popup = new PopupMenu();
        final TrayIcon trayIcon = new TrayIcon(Toolkit.getDefaultToolkit().getImage("tray.gif"), "OECSM", popup);//new TrayIcon(createImage("images/bulb.gif", "tray icon"));
        final SystemTray tray = SystemTray.getSystemTray();

        MenuItem showItem = new MenuItem("Show");
        MenuItem hideItem = new MenuItem("Hide");
        MenuItem exitItem = new MenuItem("Exit");

        showItem.addActionListener(showListener);
        hideItem.addActionListener(hideListener);
        exitItem.addActionListener(exitListener);

        popup.add(showItem);
        popup.addSeparator();
        popup.add(hideItem);
        popup.addSeparator();
        popup.add(exitItem);

        trayIcon.setPopupMenu(popup);

        try {
            tray.add(trayIcon);
        } catch (AWTException ex) {
            Mediator.getLogger(DaemonManager.class.getName()).log(Level.INFO, null, ex);
View Full Code Here

public class JavaIconAdapter implements TrayIconAdapter {

  private final TrayIcon trayIcon;

  public JavaIconAdapter(URL imageUrl, String tooltip, PopupMenu popup) {
    trayIcon = new TrayIcon(ImageLoader.load(imageUrl), tooltip, popup);
  }
View Full Code Here

    PopupMenu pop = new PopupMenu(); // ����һ���Ҽ�����ʽ�˵�
    MenuItem show = new MenuItem("�򿪳���");
    MenuItem exit = new MenuItem("�˳�����");
    pop.add(show);
    pop.add(exit);
    trayIcon = new TrayIcon(icon.getImage(), Constants.TITLE, pop);

    final JDapFrame thiz = this;
    trayIcon.addMouseListener(new MouseAdapter() {
      public void mouseClicked(MouseEvent e) {// ������������������������ͼ����˫��ʱ��Ĭ����ʾ����
        if (e.getClickCount() == 2) {// ���˫��
View Full Code Here

        this.appName = appName;
        SystemTray tray = SystemTray.getSystemTray();
        if (!SystemTray.isSupported()) {
            throw new RuntimeException("Tray is not supported");
        }
        trayIcon = new TrayIcon(baseImage, appName);
        final PopupMenu popup = createMenu(popupItems);
        trayIcon.setPopupMenu(popup);
        trayIcon.addMouseListener(new MouseListener() {

            @Override
View Full Code Here

      });
    }
  }

  private static void createSystemTray() {
    TrayIcon tray = new TrayIcon(IconFactory.createStationMonitorTray().getImage(),
        "Monitor de Tempo");
   
    tray.setPopupMenu(createTrayMenu());
    try {
      SystemTray.getSystemTray().add(tray);
    } catch (AWTException e) {
      //Se ocorrer alguma exception, realmente
      //n�o fazer nada; somente imprimir o trace
View Full Code Here

        PopupMenu popup = new PopupMenu();
        MenuItem defaultItem = new MenuItem("Exit");
        defaultItem.addActionListener(exitListener);
        popup.add(defaultItem);

        trayIcon = new TrayIcon(image, "Notification Monitor", popup);
        trayIcon.setImageAutoSize(true);
        tray.add(trayIcon);


    }
View Full Code Here

            popup.add(configsItem);
            popup.add(notifyItem);
            popup.addSeparator();
            popup.add(exitItem);

            trayIcon = new TrayIcon(opengrokImage, "OpenGrok Agent Client", popup);

            final ActionListener actionListener = getAgentActionListener();

            if (agent == null || !agent.isConnected()) {
                trayIcon.setImage(noConnectionImage);
View Full Code Here

                    System.out.println("Open");

                }
            });
            popup.add(defaultItem);
            trayIcon = new TrayIcon(image, "Moneychanger", popup);
            trayIcon.setImageAutoSize(true);
        } else {
            System.out.println("system tray not supported");
        }
        final String os = System.getProperty("os.name").toLowerCase();
View Full Code Here


            // load icon image
            try {
                Image image = ImageIO.read(SystrayListener.class.getResource("systray.png"));
                icon = new TrayIcon(image,"Apache Marmotta",popup);
                icon.setImageAutoSize(true);
                tray.add(icon);

            } catch (IOException e) {
                log.error("SYSTRAY: could not load the logo for system tray",e);
View Full Code Here

TOP

Related Classes of java.awt.TrayIcon

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.