Main.java 文件源码

java
阅读 20 收藏 0 点赞 0 评论 0

项目:languagetool 作者:
private void hideToTray() {
  if (!isInTray) {
    SystemTray tray = SystemTray.getSystemTray();
    String iconPath = tray.getTrayIconSize().height > 16 ? TRAY_ICON : TRAY_SMALL_ICON;
    URL iconUrl = JLanguageTool.getDataBroker().getFromResourceDirAsUrl(iconPath);
    Image img = Toolkit.getDefaultToolkit().getImage(iconUrl);
    PopupMenu popup = makePopupMenu();
    try {
      trayIcon = new TrayIcon(img, TRAY_TOOLTIP, popup);
      trayIcon.addMouseListener(new TrayActionListener());
      setTrayIcon();
      tray.add(trayIcon);
    } catch (AWTException e1) {
      Tools.showError(e1);
    }
  }
  isInTray = true;
  frame.setVisible(false);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号