LangToolMain.java 文件源码

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

项目:oStorybook 作者:
void hideToTray() {
    if (!isInTray) {
        final java.awt.SystemTray tray = java.awt.SystemTray
                .getSystemTray();
        final Image img = Toolkit.getDefaultToolkit().getImage(
                JLanguageTool.getDataBroker().getFromResourceDirAsUrl(
                        LangToolMain.SYSTEM_TRAY_ICON_NAME));
        final PopupMenu popup = makePopupMenu();
        try {
            final java.awt.TrayIcon trayIcon = new java.awt.TrayIcon(img,
                    "tooltip", popup);
            trayIcon.addMouseListener(new TrayActionListener());
            trayIcon.setToolTip(SYSTEM_TRAY_TOOLTIP);
            tray.add(trayIcon);
        } catch (final AWTException e1) {
            // thrown if there's no system tray
            Tools.showError(e1);
        }
    }
    isInTray = true;
    frame.setVisible(false);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号