Package java.awt

Examples of java.awt.TrayIcon


          parentFrame.setState(Frame.NORMAL);
          parentFrame.toFront();
        }
      }
    };
    trayIcon = new TrayIcon(icon, "Jalk", popup);
    trayIcon.addActionListener(restoreParentFrame);
    try {
      tray.add(trayIcon);
      trayIconAvailable = true;
    } catch (final AWTException e) {
View Full Code Here


        return;
      }

        //  Crear el TrayIcon
        iconImage = getIcon();
        trayIcon = new TrayIcon(iconImage, Constants.APPLICATION_NAME_MSG, menu.createPopupMenu(this));
     
        // Evento de doble click izquierdo
        trayIcon.setActionCommand(Constants.TRAY_ICON_ACTION_COMMAND);
        trayIcon.setToolTip(Constants.TRAY_ICON_TOOL_TIP_MSG);
        trayIcon.addActionListener(this);
View Full Code Here

        menu.add(itemOpcoes);
        menu.addSeparator();
        menu.add(itemSair);

        trayIcon = new TrayIcon(icon, "Tooltip", menu);

        try {
            tray.add(trayIcon);
            trayIcon.addMouseListener(new MouseAdapter() {
View Full Code Here

    }

    this.nanoDoAMain = nanoDoAMain;

    images = createTrayIconImage();
    trayIcon = new TrayIcon(images[0]);
    systemTray = SystemTray.getSystemTray();

    PopupMenu popup = new PopupMenu();
    aboutItem = new MenuItem("About");
    aboutItem.addActionListener(this);
View Full Code Here

    popup.add(getMenuItem("Exit", new StopSystemAction()));
    return popup;
  }

  private void createTrayIcon(PopupMenu popup) throws AWTException {
    trayIcon = new TrayIcon(images[0]);
    trayIcon.setPopupMenu(popup);
    trayIcon.setToolTip("NanoDoA");
    trayIcon.addActionListener(new ShowMainWindowAction());
    systemTray = SystemTray.getSystemTray();
    systemTray.add(trayIcon);
View Full Code Here

                bi.getGraphics().drawImage(iconImage, (trayIconSize.width-TRAY_ICON_WIDTH)/2, (trayIconSize.height-TRAY_ICON_HEIGHT)/2, null);
                iconImage = bi;
            }

            // Create the tray icon and disable image auto-size which shouldn't be used anyway but just in case
            trayIcon = new TrayIcon(iconImage);
            trayIcon.setImageAutoSize(false);

            // Create the popup (AWT!) menu. Note there is no way with java.awt.Menu to know when the menu is selected
            // and thus it makes it hard to have contextual menu items such as the list of open windows.
            PopupMenu menu = new PopupMenu();
View Full Code Here

        if (isJavaSystemTrayJDICsupported()) {
            org.jdesktop.jdic.tray.TrayIcon trayIcon = new org.jdesktop.jdic.tray.TrayIcon(new ImageIcon(icon));
            org.jdesktop.jdic.tray.SystemTray.getDefaultSystemTray().addTrayIcon(trayIcon);
            this.icon = trayIcon;
        } else if (isJavaSystemTray6Supported()) {
            TrayIcon trayIcon;
            try {
                trayIcon = new TrayIcon(ImageIO.read(icon));
                SystemTray.getSystemTray().add(trayIcon);
                this.icon = trayIcon;
            } catch (Exception ex) {
                ex.printStackTrace();
            }
View Full Code Here

    public void createSystemTray() {

        if (SystemTray.isSupported()) {
            SystemTray tray = SystemTray.getSystemTray();
            Image createImage = Toolkit.getDefaultToolkit().getImage(getClass().getResource("/de/chucknorris/client/images/chuck_norris.png"));
            trayIcon = new TrayIcon(createImage, "Chuck Norris Citations", createPopupMenu());
            trayIcon.setImageAutoSize(true);
            trayIcon.addActionListener(this);
            trayIcon.setActionCommand(Constants.CITATION);

            try {
View Full Code Here

  public TrayManager(MainFrame mainFrame)
  {
    this.mainFrame = mainFrame;

    Image iconImage = new ImageIcon("gfx/icons/16x16.png").getImage();
    trayIcon = new TrayIcon(iconImage, Settings.title, new TrayMenu(this));

    trayed = false;

    mainFrame.addWindowListener(new MainFrameListener());
    trayIcon.addMouseListener(this);
View Full Code Here

   
    frame.setIconImage(idleIcon);
   
    // If system tray is supported by OS
    if (SystemTray.isSupported()) {
      trayIcon = new TrayIcon(idleIcon,"Nebula Grid Node", createTrayPopup());
      trayIcon.setImageAutoSize(true);
      trayIcon.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent 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.