-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
9, 11, 15, 16, 17
-
x86_64
-
windows_10
ADDITIONAL SYSTEM INFORMATION :
Windows 10, Java 15 and 16, with monitor display scaling set to 125% or greater.
A DESCRIPTION OF THE PROBLEM :
This looks like a problem with the rendering pipeline when the monitor display scaling is 125% or greater on Windows. It's a severe regression since Java 8, there are very noticeable rendering artifacts.
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create JButtons with icons containing text, see attached test case.
2. Run with Java 8 and then Java 15 or 16 using monitor with display scaling set to 125% or greater on Windows 10.
Run the attached test case with good quality png icons containing text. I have screenshot showing the bug, and png icons, but don't see a way to attach them here.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Good quality button icon, same as with Java 8
ACTUAL -
Very poor quality button icon with Java 15 and 16, image is noticeably degraded with rendering artifacts
---------- BEGIN SOURCE ----------
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
public class TestButtonImage {
/**
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
*/
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Set up the content pane.
JPanel panel = new JPanel();
String url = "C:\\temp\\36point.png";
String url72 = "C:\\temp\\72point.png";
// Image image = Toolkit.getDefaultToolkit().createImage(url);
// ImageIcon icon = new ImageIcon(image);
ImageIcon icon = new ImageIcon(url);
JButton button = new JButton(icon);
ImageIcon icon72 = new ImageIcon(url72);
JButton button72 = new JButton(icon72);
panel.add(button);
panel.add(button72);
frame.getContentPane().add(panel);
//Display the window.
String javaVersion = System.getProperty("java.version");
String osName = System.getProperty("os.name");
frame.setTitle("Java " + javaVersion + " " + osName);
frame.pack();
frame.setSize(500,500);
frame.setVisible(true);
}
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
-Dsun.java2d.uiScale=1
FREQUENCY : always
Windows 10, Java 15 and 16, with monitor display scaling set to 125% or greater.
A DESCRIPTION OF THE PROBLEM :
This looks like a problem with the rendering pipeline when the monitor display scaling is 125% or greater on Windows. It's a severe regression since Java 8, there are very noticeable rendering artifacts.
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create JButtons with icons containing text, see attached test case.
2. Run with Java 8 and then Java 15 or 16 using monitor with display scaling set to 125% or greater on Windows 10.
Run the attached test case with good quality png icons containing text. I have screenshot showing the bug, and png icons, but don't see a way to attach them here.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Good quality button icon, same as with Java 8
ACTUAL -
Very poor quality button icon with Java 15 and 16, image is noticeably degraded with rendering artifacts
---------- BEGIN SOURCE ----------
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
public class TestButtonImage {
/**
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
*/
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Set up the content pane.
JPanel panel = new JPanel();
String url = "C:\\temp\\36point.png";
String url72 = "C:\\temp\\72point.png";
// Image image = Toolkit.getDefaultToolkit().createImage(url);
// ImageIcon icon = new ImageIcon(image);
ImageIcon icon = new ImageIcon(url);
JButton button = new JButton(icon);
ImageIcon icon72 = new ImageIcon(url72);
JButton button72 = new JButton(icon72);
panel.add(button);
panel.add(button72);
frame.getContentPane().add(panel);
//Display the window.
String javaVersion = System.getProperty("java.version");
String osName = System.getProperty("os.name");
frame.setTitle("Java " + javaVersion + " " + osName);
frame.pack();
frame.setSize(500,500);
frame.setVisible(true);
}
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
-Dsun.java2d.uiScale=1
FREQUENCY : always