我正在创建一个推送通知的 Java 程序,我想删除或编辑显示“Java(TM) Platform SE binary”的行。
这可能吗?我在谷歌上搜索过,但看不到这方面的信息。
这是相关代码。最后一行是推送通知的行。
public void mostrarNotificacion(Usuario user) throws AWTException, java.net.MalformedURLException, IOException {
//Obtain only one instance of the SystemTray object
SystemTray tray = SystemTray.getSystemTray();
//Get image
BufferedImage trayIconImage = ImageIO.read(getClass().getResource("favicon.png"));
int trayIconWidth = new TrayIcon(trayIconImage).getSize().width;
TrayIcon trayIcon = new TrayIcon(trayIconImage.getScaledInstance(trayIconWidth, -1, Image.SCALE_SMOOTH));
//Let the system resizes the image if needed
trayIcon.setImageAutoSize(true);
//Set tooltip text and notification text
if(user.getDescargos()>=5 || user.getOtrosPendientes()>=1){
mensaje = "Descargos pendientes: " + user.getDescargos() + "\nSecciones pendientes: "+ user.getOtrosPendientes();
}
trayIcon.setToolTip(mensaje);
tray.add(trayIcon);
trayIcon.displayMessage("Pendientes EKHI", mensaje, MessageType.WARNING);
}
最佳答案
关于java - 来自 Java 的 Windows 10 通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45233230/