When making a Windows 10 notification how do I put a custom picture? I'm a fairly new coder and wanted to try making a notification program, what I'm trying to do is to make a program to notify me when I use OBS's replay buffer to record a clip and want it to pop up with a notification confirming a clip was saved that has the name of the clip saved in the body of the notification and then when I click it brings me to the clip's folder location. To start off here's my code for just the notification part:
import java.awt.*;
import java.awt.TrayIcon.MessageType;
public class OBSNotif {
public static void main(String[] args) throws AWTException {
if (SystemTray.isSupported()) {
OBSNotif td = new OBSNotif();
td.displayTray();
} else {
System.err.println("System tray not supported!");
}
}
public void displayTray() throws AWTException {
SystemTray tray = SystemTray.getSystemTray();
Image image = Toolkit.getDefaultToolkit().createImage(getClass().getResource("icon.png"));
TrayIcon trayIcon = new TrayIcon(image, "OBS");
trayIcon.setImageAutoSize(true);
trayIcon.setToolTip("OBS save notification");
tray.add(trayIcon);
trayIcon.displayMessage("OBS", "INSERT VIDEO ID" + " has been saved", MessageType.NONE);
}
}
The result of the code is something like this:
https://i.stack.imgur.com/cbWw6.png
and the icon is just put into the system tray
but how can I have the icon in the notification like something like this?
While on the subject how would I set up a listener for when I click on the notification to open an explorer window of a folder or fetch the name of the most recently added video to the folder where the clips are saved?