本文整理了Java中java.awt.TrayIcon.setToolTip()
方法的一些代码示例,展示了TrayIcon.setToolTip()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TrayIcon.setToolTip()
方法的具体详情如下:
包路径:java.awt.TrayIcon
类名称:TrayIcon
方法名:setToolTip
暂无
代码示例来源:origin: RipMeApp/ripme
mainIcon = ImageIO.read(getClass().getClassLoader().getResource("icon.png"));
trayIcon = new TrayIcon(mainIcon);
trayIcon.setToolTip(mainFrame.getTitle());
trayIcon.setImageAutoSize(true);
trayIcon.setPopupMenu(trayMenu);
代码示例来源:origin: blurpy/kouchat
/**
* Sets the tooltip on the system tray icon.
*
* @param toolTip The tooltip to set.
*/
public void setToolTip(final String toolTip) {
if (trayIcon != null) {
trayIcon.setToolTip(toolTip);
}
}
代码示例来源:origin: chatty/chatty
/**
* Sets the tooltip of the tray icon. Does nothing if the tray is not
* available.
*
* @param text The text to set the tooltip to
*/
public void setTooltipText(String text) {
if (trayIcon != null) {
trayIcon.setToolTip(text);
}
}
代码示例来源:origin: fr.ifremer/isis-fish
@Override
public void setToolTip(String text) {
trayIcon.setToolTip(text);
}
代码示例来源:origin: SSilence/scotty
public void setTooltip(String tooltip) {
if (isSupported()) {
icon.setToolTip(tooltip);
}
}
代码示例来源:origin: stackoverflow.com
SystemTray tray = SystemTray.getSystemTray();
TrayIcon icon = new TrayIcon(....);
icon.setToolTip("I have finished my work");
icon.setActionListener(this);
tray.add(trayIcon);
代码示例来源:origin: scruel/ClipIt
private static void addTray(GlobalHotkeyListener hotkeyListener) throws AWTException {
ImageIcon imageIcon = new ImageIcon(Objects.requireNonNull(TipsFrame.class.getClassLoader().getResource("ClipIt.png")));
TrayIcon trayIcon = new TrayIcon(imageIcon.getImage());
trayIcon.setToolTip("ClipIt");
PopupMenu popupMenu = new PopupMenu();
MenuItem exitMenuItem = new MenuItem("Exit");
exitMenuItem.addActionListener(actionEvent -> hotkeyListener.destroy());
popupMenu.add(exitMenuItem);
trayIcon.setPopupMenu(popupMenu);
SystemTray systemTray = SystemTray.getSystemTray();
systemTray.add(trayIcon);
}
代码示例来源:origin: Slowpoke101/FTBLaunch
public static void setUpSystemTray () {
trayMenu = new TrayMenu();
SystemTray tray = SystemTray.getSystemTray();
TrayIcon trayIcon = new TrayIcon(Toolkit.getDefaultToolkit().getImage(instance.getClass().getResource("/image/logo_ftb.png")));
trayIcon.setPopupMenu(trayMenu);
trayIcon.setToolTip(Constants.name);
trayIcon.setImageAutoSize(true);
try {
tray.add(trayIcon);
} catch (AWTException e) {
e.printStackTrace();
}
}
代码示例来源:origin: abc9070410/JComicDownloader
protected void singlePagePost( String title, String wholeTitle, String url,
String queryString, int totalPage, int nowPageNumber, String fileName,
boolean needCookie, String cookieString, String referURL ) {
if ( wholeTitle == null ) {
CommonGUI.stateBarMainMessage = title + " : ";
}
else {
CommonGUI.stateBarMainMessage = title + "/" + wholeTitle + " : ";
}
CommonGUI.stateBarDetailMessage = "共" + totalPage + "頁,第" + ( nowPageNumber ) + "頁下載中";
if ( SetUp.getShowDoneMessageAtSystemTray() && Common.withGUI() ) {
ComicDownGUI.trayIcon.setToolTip( CommonGUI.stateBarMainMessage
+ CommonGUI.stateBarDetailMessage );
}
CommonGUI.stateBarDetailMessage += ": [" + fileName + "]";
Common.downloadPost( url, getDownloadDirectory(),
fileName, false, "", queryString, url );
}
代码示例来源:origin: abc9070410/JComicDownloader
private void clearRecord() {
int recordListCount = recordTableModel.getRowCount();
while (recordTableModel.getRowCount() > 1) {
recordTableModel.removeRow(recordTableModel.getRowCount() - 1);
Common.recordCount--;
}
if (Common.recordCount > 0) {
recordTableModel.removeRow(0);
}
repaint(); // 重繪
Common.recordCount = 0;
Common.processPrint("全部記錄清空");
stateBar.setText("全部記錄清空");
trayIcon.setToolTip("JComicDownloader");
}
代码示例来源:origin: abc9070410/JComicDownloader
private void clearMission() { // 清空下載任務
int downListCount = downTableModel.getRowCount();
while (downTableModel.getRowCount() > 1) {
downTableModel.removeRow(downTableModel.getRowCount() - 1);
Common.missionCount--;
}
if (Common.missionCount > 0) {
downTableModel.removeRow(0);
}
repaint(); // 重繪
Common.missionCount = 0;
Common.processPrint("全部下載任務清空");
stateBar.setText("全部下載任務清空");
trayIcon.setToolTip("JComicDownloader");
}
代码示例来源:origin: abc9070410/JComicDownloader
private void clearBookmark() { // 清空書籤
int bookmarkListCount = bookmarkTableModel.getRowCount();
while (bookmarkTableModel.getRowCount() > 1) {
bookmarkTableModel.removeRow(bookmarkTableModel.getRowCount() - 1);
Common.bookmarkCount--;
}
if (Common.bookmarkCount > 0) {
bookmarkTableModel.removeRow(0);
}
repaint(); // 重繪
Common.bookmarkCount = 0;
Common.processPrint("全部書籤清空");
stateBar.setText("全部書籤清空");
trayIcon.setToolTip("JComicDownloader");
}
代码示例来源:origin: com.github.tornaia/aott-desktop-client-core
trayIcon.setToolTip(applicationSettings.getDesktopClientName());
trayIcon.setImageAutoSize(true);
代码示例来源:origin: mguessan/davmail
public void run() {
if (trayIcon != null) {
TrayIcon.MessageType messageType = null;
if (level.equals(Level.INFO)) {
messageType = TrayIcon.MessageType.INFO;
} else if (level.equals(Level.WARN)) {
messageType = TrayIcon.MessageType.WARNING;
} else if (level.equals(Level.ERROR)) {
messageType = TrayIcon.MessageType.ERROR;
}
if (messageType != null) {
trayIcon.displayMessage(BundleMessage.format("UI_DAVMAIL_GATEWAY"), message, messageType);
}
trayIcon.setToolTip(BundleMessage.format("UI_DAVMAIL_GATEWAY") + '\n' + message);
}
}
});
代码示例来源:origin: xXKeyleXx/MyPet
private static void createTraymenu(Image logoImage) {
trayIcon = new TrayIcon(logoImage);
MenuItem exitItem = new MenuItem("Exit");
exitItem.addActionListener(e -> {
close();
});
MenuItem reopenItem = new MenuItem("Reopen");
reopenItem.addActionListener(e -> {
try {
Desktop.getDesktop().browse(new URI("http://localhost:64712"));
} catch (URISyntaxException | IOException e2) {
e2.printStackTrace();
}
});
PopupMenu popup = new PopupMenu();
popup.add(reopenItem);
popup.add(exitItem);
trayIcon.setPopupMenu(popup);
trayIcon.setToolTip("MyPet - SkilltreeCreator");
try {
SystemTray.getSystemTray().add(trayIcon);
} catch (AWTException e) {
e.printStackTrace();
}
trayIcon.displayMessage("MyPet - SkilltreeCreator", "The SkilltreeCreator is running. You can exit it via the tray icon.", TrayIcon.MessageType.INFO);
}
代码示例来源:origin: stackoverflow.com
trayIcon.setToolTip("System tray icon demo");
tray.add(trayIcon);
trayIcon.displayMessage("Hello, World", "notification demo", MessageType.INFO);
代码示例来源:origin: ATLauncher/ATLauncher
/**
* This tries to create the system tray menu.
*
* @throws Exception
*/
private static void trySystemTrayIntegration() throws Exception {
if (SystemTray.isSupported()) {
SystemTray tray = SystemTray.getSystemTray();
TrayIcon trayIcon = new TrayIcon(Utils.getImage("/assets/image/Icon.png"));
trayIcon.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON3) {
TRAY_MENU.setInvoker(TRAY_MENU);
TRAY_MENU.setLocation(e.getX(), e.getY());
TRAY_MENU.setVisible(true);
}
}
});
trayIcon.setToolTip(Constants.LAUNCHER_NAME);
trayIcon.setImageAutoSize(true);
tray.add(trayIcon);
}
}
代码示例来源:origin: mguessan/davmail
public void run() {
if (trayIcon != null) {
Icon icon = null;
if (level.equals(Level.INFO)) {
icon = UIManager.getIcon("OptionPane.informationIcon");
} else if (level.equals(Level.WARN)) {
icon = UIManager.getIcon("OptionPane.warningIcon");
} else if (level.equals(Level.ERROR)) {
icon = UIManager.getIcon("OptionPane.errorIcon");
}
if (icon != null && message != null && message.length() > 0) {
try {
String title = BundleMessage.format("UI_DAVMAIL_GATEWAY");
Growl growl = GrowlUtils.getGrowlInstance("DavMail");
growl.addNotification(title, true);
growl.register();
growl.sendNotification(title, title, message, (RenderedImage) getImageForIcon(icon));
} catch (GrowlException growlException) {
LOGGER.error(growlException);
}
}
trayIcon.setToolTip(BundleMessage.format("UI_DAVMAIL_GATEWAY") + '\n' + message);
}
}
});
代码示例来源:origin: abc9070410/JComicDownloader
protected void singlePageDownload( String title, String wholeTitle, String url, int totalPage, int nowPageNumber, String fileName,
int delayTime, boolean needCookie, String cookieString, String referURL, boolean fastMode ) {
if ( !SetUp.getDownloadPicFile() ) { // 分析後不下載圖檔
return;
}
if ( wholeTitle == null ) {
CommonGUI.stateBarMainMessage = title + " : ";
}
else {
CommonGUI.stateBarMainMessage = title + "/" + wholeTitle + " : ";
}
CommonGUI.stateBarDetailMessage = "共" + totalPage + "頁,第" + ( nowPageNumber ) + "頁下載中";
if ( SetUp.getShowDoneMessageAtSystemTray() && Common.withGUI() ) {
ComicDownGUI.trayIcon.setToolTip( CommonGUI.stateBarMainMessage
+ CommonGUI.stateBarDetailMessage );
}
CommonGUI.stateBarDetailMessage += ": [" + fileName + "]";
if ( delayTime == 0 ) {
Common.downloadFile( url, getDownloadDirectory(), fileName, needCookie, cookieString, referURL,
fastMode, SetUp.getRetryTimes(), false, false );
}
else {
Common.slowDownloadFile( url, getDownloadDirectory(), fileName, delayTime, needCookie, cookieString );
}
}
代码示例来源:origin: SKCraft/Launcher
trayIcon.setToolTip(SharedLocale.tr("console.trayTooltip"));
内容来源于网络,如有侵权,请联系作者删除!