Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8296633

Window UI unpainted when moving from monitor with 100% scale to monitor with 125% scale

XMLWordPrintable

    • 2d
    • 16
    • x86_64
    • windows_10
    • Not verified

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10,
      Corrupted: JDK16, JDK17, JDK18, JDK19
      Working: JDK15

      A DESCRIPTION OF THE PROBLEM :
      This is a duplicate of JDK-8224608. Please recheck it! IMHO this is not a duplicate of JDK-8224608 and does not relate to JDK-8230461.

      Precondition: sun.java2d.uiScale.enabled is "false".
      Problem: 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).

      REGRESSION : Last worked in version 15

      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 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 :
      use JDK 15
      or
      System.setProperty("sun.java2d.uiScale.enabled", "true");

      FREQUENCY : always


            rmahajan Rajat Mahajan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: