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);
}
Main.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:languagetool
作者:
评论列表
文章目录