I know how to do this kind of notifications:
But it turns out that it only changes the icon when changing the message type:
trayIcon.displayMessage("Titulo", "Contenido", TrayIcon.MessageType.INFO);
It's the only thing I could find on the internet, do you have any idea what you could do?
Here I leave the code of the TrayIcon with which I use the displayMessage ():
public void IconoBandeja(){
if(!SystemTray.isSupported()){
System.out.println("We can't show the Tray Icon");
}
final PopupMenu popup = new PopupMenu();
trayIcon = new TrayIcon(CreateIcon("/img/logo.jpg", "Administrador de clientes"));
trayIcon.setImageAutoSize(true);
final SystemTray tray = SystemTray.getSystemTray();
//trayIcon.setToolTip("Version 1.6.21\nProject Jarvis");
//Add components/ Menu items
MenuItem AboutItem = new MenuItem("About");
MenuItem ExitItem = new MenuItem("Exit");
//Populate the pop up menu
popup.add(AboutItem);
popup.addSeparator();
popup.add(ExitItem);
trayIcon.setPopupMenu(popup);
AboutItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
trayIcon.displayMessage("Titulo", "Contenido", TrayIcon.MessageType.INFO);
}
});
try
{
tray.add(trayIcon);
}catch (AWTException e)
{
}
}