-
Bug
-
Resolution: Unresolved
-
P3
-
8, 11, 17, 21, 22, 23
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
JDK 21.0.1
Windows 11
A DESCRIPTION OF THE PROBLEM :
Notifications shown from a TrayIcon shows a corrupted image even if the image is correctly visible in the traybar.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Simply create a trayicon with an image and show a notification from it.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Image should be correctly visible in the notification
ACTUAL -
Image shown in the notification is corrupted
---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class Main {
public static void main(String[] args) throws Exception {
var frame = new Frame("Notification Example");
var button = new Button("Notify");
frame.add(button);
Image image= Toolkit.getDefaultToolkit().getImage(Main.class.getResource("/org/your_resource_package/your_image.png"));
var trayIcon = new TrayIcon(image);
SystemTray.getSystemTray().add(trayIcon);
trayIcon.setImageAutoSize(true);
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
e.getWindow().dispose();
System.exit(0);
}
});
button.addActionListener(e -> {
trayIcon.displayMessage("Hello World", "Lorem ipsum", TrayIcon.MessageType.INFO);
});
frame.pack();
frame.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
no workaround found
FREQUENCY : always
JDK 21.0.1
Windows 11
A DESCRIPTION OF THE PROBLEM :
Notifications shown from a TrayIcon shows a corrupted image even if the image is correctly visible in the traybar.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Simply create a trayicon with an image and show a notification from it.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Image should be correctly visible in the notification
ACTUAL -
Image shown in the notification is corrupted
---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class Main {
public static void main(String[] args) throws Exception {
var frame = new Frame("Notification Example");
var button = new Button("Notify");
frame.add(button);
Image image= Toolkit.getDefaultToolkit().getImage(Main.class.getResource("/org/your_resource_package/your_image.png"));
var trayIcon = new TrayIcon(image);
SystemTray.getSystemTray().add(trayIcon);
trayIcon.setImageAutoSize(true);
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
e.getWindow().dispose();
System.exit(0);
}
});
button.addActionListener(e -> {
trayIcon.displayMessage("Hello World", "Lorem ipsum", TrayIcon.MessageType.INFO);
});
frame.pack();
frame.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
no workaround found
FREQUENCY : always
- relates to
-
JDK-8255439 System Tray icons get corrupted when Windows scaling changes
- Resolved
-
JDK-8305645 System Tray icons get corrupted when Windows primary monitor changes
- Resolved