我正在创建一个推送通知的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);
}

发布于 2020-04-21 00:28:22
如果使用TrayIcon.MessageType.NONE,则不会出现“Java SE binary”
示例图像:

发布于 2018-01-18 10:34:56
解决这个问题的唯一方法是使用java本地启动器。
我的最佳选择是javapackager,它允许您捆绑JVM的本地副本,使您的应用程序完全可移植。
另一个选项是launch4j,它只创建一个启动程序,但仍然需要安装Java。
https://stackoverflow.com/questions/45233230
复制相似问题