Package java.awt

Examples of java.awt.PopupMenu$AccessibleAWTPopupMenu


      image = ImageIO.read(RS2Lite.class.getResourceAsStream("/icon.png"));
    } catch (IOException e1) {
      e1.printStackTrace();
    }
    // Add uploaders from the list we loaded earlier
    PopupMenu tray = new PopupMenu();
    MenuItem screenshot = new MenuItem("Screenshot");
    screenshot.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        screenshot();
      }
    });
    tray.add(screenshot);
    //Exit menu
    MenuItem exit = new MenuItem("Exit");
    exit.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        System.exit(0);
      }

    });
    tray.add(exit);
    SystemTrayAdapter adapter = SystemTrayProvider.getSystemTray();
    icon = adapter.createAndAddTrayIcon(RS2Lite.class.getResource("/icon.png"), APPLICATION_TITLE,
        tray);
   
  }
View Full Code Here


   * ϵͳ����
   */
  public void tray() {
    tray = SystemTray.getSystemTray(); // ��ñ�����ϵͳ���̵�ʵ��
    ImageIcon icon = new ImageIcon(Constants.IMAGE_ICON); // ��Ҫ��ʾ�������е�ͼ��
    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) {// ������������������������ͼ����˫��ʱ��Ĭ����ʾ����
View Full Code Here

        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
            public void mouseClicked(MouseEvent e) {
View Full Code Here

   }



    protected final PopupMenu createMenu(List popupItems) {
        final PopupMenu popup = new PopupMenu("Menu");
        for (Object object : popupItems) {
            if (object instanceof MenuItem) {
                popup.add((MenuItem)object);
            }
            if (MENU_SEPERATOR.equals(object)) {
                popup.addSeparator();
            }
        }
        return popup;
    }
View Full Code Here

      e.printStackTrace();
    }
  }
 
  public static PopupMenu createTrayMenu() {
    PopupMenu menu = new PopupMenu();

    final MenuItem itemShowTimer = new MenuItem("Esconder Timer");
    itemShowTimer.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        if (TimerScreen.getInstance().isVisible()) {
          TimerScreen.getInstance().setVisible(false);
          itemShowTimer.setLabel("Mostrar Timer");
        } else {
          TimerScreen.splash();
          itemShowTimer.setLabel("Esconder Timer");
        }
      }
    });

    MenuItem itemTerminate = new MenuItem("Encerrar");
    itemTerminate.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        TimerScreen.getInstance().stopTimer();
        BlockScreen.splash();
      }
    });
   
   
    menu.add(itemShowTimer);
    menu.add(itemTerminate);
    return menu;
  }
View Full Code Here

    static PopupMenu delegate = null;

    AWTInputMethodPopupMenu(String title) {
        synchronized (this) {
            if (delegate == null) {
                delegate = new PopupMenu(title);
            }
        }
    }
View Full Code Here

                System.out.println("Exiting monitor...");
                System.exit(0);
            }
        };

        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

            final ActionListener showNotificationsListener = getShowNotificationListener(notificationWindowListener);
            final ActionListener configListener = this.getConfigurationListener();

            log.info("Creating popup and tray icon ");

            PopupMenu popup = new PopupMenu();
            MenuItem exitItem = new MenuItem("Exit");
            exitItem.addActionListener(exitListener);
            MenuItem settingsItem = new MenuItem("Connection Settings");
            settingsItem.addActionListener(settingsListener);
            MenuItem configsItem = new MenuItem("Configurations");
            configsItem.addActionListener(configListener);
            MenuItem notifyItem = new MenuItem("Show notifications");
            notifyItem.addActionListener(showNotificationsListener);

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

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

            final ActionListener actionListener = getAgentActionListener();
View Full Code Here

                public void actionPerformed(ActionEvent e) {
                    System.out.println("Exiting....");
                    System.exit(0);
                }
            };
            PopupMenu popup = new PopupMenu();
            MenuItem defaultItem = new MenuItem("Exit");
            defaultItem.addActionListener(exitListener);
            popup.add(defaultItem);
            defaultItem = new MenuItem("Open");
            defaultItem.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                    //tray.remove(trayIcon);
                    setVisible(true);
                    repaint();
                    setVisible(true);
                    System.out.println("Open");

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

            // SystemTray.isSupported();
            boolean supported = (Boolean) Utils.callStaticMethod("java.awt.SystemTray.isSupported");
            if (!supported) {
                return false;
            }
            PopupMenu menuConsole = new PopupMenu();
            MenuItem itemConsole = new MenuItem("H2 Console");
            itemConsole.setActionCommand("console");
            itemConsole.addActionListener(this);
            itemConsole.setFont(font);
            menuConsole.add(itemConsole);
            MenuItem itemStatus = new MenuItem("Status");
            itemStatus.setActionCommand("status");
            itemStatus.addActionListener(this);
            itemStatus.setFont(font);
            menuConsole.add(itemStatus);
            MenuItem itemExit = new MenuItem("Exit");
            itemExit.setFont(font);
            itemExit.setActionCommand("exit");
            itemExit.addActionListener(this);
            menuConsole.add(itemExit);

            // tray = SystemTray.getSystemTray();
            tray = Utils.callStaticMethod("java.awt.SystemTray.getSystemTray");

            // Dimension d = tray.getTrayIconSize();
View Full Code Here

TOP

Related Classes of java.awt.PopupMenu$AccessibleAWTPopupMenu

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.