如何增加java的显示超时。awt。系统托盘?
我使用下面的代码通过我的应用程序在屏幕上显示系统托盘。但我无法找到如何增加其显示超时。有人能帮忙吗
SystemTray tray = SystemTray.getSystemTray();
//If the icon is a file
Image image = Toolkit.getDefaultToolkit().createImage("icon.png");
//Alternative (if the icon is on the classpath):
//Image image = Toolkit.getToolkit().createImage(getClass().getResource("icon.png"));
TrayIcon trayIcon = new TrayIcon(image, "Tray Demo");
//Let the system resizes the image if needed
trayIcon.setImageAutoSize(true);
//Set tooltip text for the tray icon
trayIcon.setToolTip("System tray icon demo");
tray.add(trayIcon);
trayIcon.displayMessage("Applicaiton ver 4", "Launching Application... \nPlease wait for a while !!!", MessageType.INFO);
共 (0) 个答案