示例#1
0
文件: Tray.java 项目: Tyf0n/musique
  public void install() {
    try {
      if (trayIcon == null && SystemTray.isSupported()) {
        SystemTray systemTray = SystemTray.getSystemTray();
        Dimension size = systemTray.getTrayIconSize();
        trayIcon = createTrayIcon(size);
        systemTray.add(trayIcon);

        JPopupMenu popup = new JPopupMenu();
        trayIcon.setJPopupMenu(popup);
        createPopup(popup);
      }
    } catch (AWTException e) {
      e.printStackTrace();
    }
  }
示例#2
0
文件: Tray.java 项目: Tyf0n/musique
 public void setToolTip(String toolTip) {
   if (trayIcon != null) trayIcon.setToolTip(toolTip);
 }
示例#3
0
文件: Tray.java 项目: Tyf0n/musique
 public void addMouseListener(MouseListener listener) {
   if (trayIcon != null) trayIcon.addMouseListener(listener);
 }