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

Broken content in JFrame when sun.java2d.uiScale.enabled = false

XMLWordPrintable

    • 2d
    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10
      First Monitor: 125%
      Second Monitor: 100%
      since 11.0.14, affected versions: 17, 20. (11.0.13 was OK)

      A DESCRIPTION OF THE PROBLEM :
      After moving a window from the first to the second monitor and back content is broken. Mouse click selected wrong row in a table.
      Key factor is setting sun.java2d.uiScale.enabled to false, and different scale setting for the first and the second monitors.

      REGRESSION : Last worked in version 11

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Run attached code. A window appears on first monitor. A table inside the window is displayed properly.
      2. Move the window to the second monitor. The table still looks good.
      3. Move the window back to first monitor - the content is broken.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Properly displayed window.
      ACTUAL -
      Broken content of window. There are double scrollbars, a black area to the left and bottom of the table.

      ---------- BEGIN SOURCE ----------
      public class TableExample {

      public static void main(String[] args) {
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
      public void run() {
      System.setProperty("sun.java2d.uiScale.enabled", "false");
      JFrame frame = new JFrame("Table Example");
      JTable table = new JTable( new AbstractTableModel() {
      public Object getValueAt(int r, int c) { return "" + r + " : " + c; }
      public int getRowCount() { return 100; }
      public int getColumnCount() { return 5; }
      });
      JScrollPane scrollPane = new JScrollPane(table);
      frame.add(scrollPane, BorderLayout.CENTER);
      frame.setSize(400, 400);
      frame.setVisible(true);
      }
      });
      }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


            pnarayanaswa Praveen Narayanaswamy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: