-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
16
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Windows 10, starting by JDK 16
A DESCRIPTION OF THE PROBLEM :
Precondition is a Swing application that deactivates the sun.java2d.uiScale property.
When a Swing Window (JFrame or JDialog) is dragged from one monitor with 100% DPI scaling to an other monitor with e.g. 125% DPI scaling, the Window has unpainted regions (and UI components are not usable anymore).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Use Windows 10
2. Set up two monitors, one with 100% and another with 125% DPI scaling
3. Start the code that creates a Swing JDIialog
4. Drag it from the 100% DPI monitor to the 125% DPI monitor
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
JDialog should stay with the same size (so it is under JDK 15) and should not have unpainted regions.
ACTUAL -
JDialog increases in size and the increased region is unpainted.
---------- BEGIN SOURCE ----------
import javax.swing.JDialog;
public class Main {
public static void main(String[] args) {
System.setProperty("sun.java2d.uiScale.enabled", "false");
JDialog dialog = new JDialog();
dialog.setTitle("DIALOG");
dialog.setSize(200, 200);
dialog.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
JDK 15 or lower
or System.setProperty("sun.java2d.uiScale.enabled", "true");
FREQUENCY : always
Windows 10, starting by JDK 16
A DESCRIPTION OF THE PROBLEM :
Precondition is a Swing application that deactivates the sun.java2d.uiScale property.
When a Swing Window (JFrame or JDialog) is dragged from one monitor with 100% DPI scaling to an other monitor with e.g. 125% DPI scaling, the Window has unpainted regions (and UI components are not usable anymore).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Use Windows 10
2. Set up two monitors, one with 100% and another with 125% DPI scaling
3. Start the code that creates a Swing JDIialog
4. Drag it from the 100% DPI monitor to the 125% DPI monitor
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
JDialog should stay with the same size (so it is under JDK 15) and should not have unpainted regions.
ACTUAL -
JDialog increases in size and the increased region is unpainted.
---------- BEGIN SOURCE ----------
import javax.swing.JDialog;
public class Main {
public static void main(String[] args) {
System.setProperty("sun.java2d.uiScale.enabled", "false");
JDialog dialog = new JDialog();
dialog.setTitle("DIALOG");
dialog.setSize(200, 200);
dialog.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
JDK 15 or lower
or System.setProperty("sun.java2d.uiScale.enabled", "true");
FREQUENCY : always
- duplicates
-
JDK-8296633 Window UI unpainted when moving from monitor with 100% scale to monitor with 125% scale
- Closed
- relates to
-
JDK-8230461 Wrong position of JPopupMenu when multiple displays with different DPI are used
- Closed