title: Visual artifacts with the title bar of a JFrame
body: <p>I'm working with an application based on java swing and I faced some visual artifacts with the title bar of a basic JFrame if I use the display scaling option from Windows 10. I let the system controls the &quot;Window System decorated&quot; including the title bar Look &amp; Feel because I don't want to customize this part.</p>
  <p>For example, if I set 150% I have 2 issues:</p>
  <ul>
  <li>issue1: garbage line</li>
  <li>issue2: minimize, maximize and close buttons are blinking on mouse hover</li>
  </ul>
  <p>My Setup/config:</p>
  <pre><code>Java Swing
  Windows 10
  Adopt open JDK 11
  Enable &quot;Override high DPI&quot; option with System Enhanced
  </code></pre>
  <p>What I tried:</p>
  <ul>
  <li>I used a basic JFrame demo from the Oracle website, but the same issues</li>
  <li>No scaling i.e 100% the display is OK, no more problem.</li>
  <li>Uncheck the &quot;Override high DPI&quot; option and scaling of 150%, the display is OK, no more problem</li>
  </ul>
  <p>It seems that there is something wrong with &quot;Override high DPI/System Enhanced&quot; and scaling...</p>
  <p><img src="https://i.stack.imgur.com/Uz0ni.png" alt="screenshots" /></p>
  <p>Basic JFrame example from Oracle can be used to see both artifacts:</p>
  <pre class="lang-java prettyprint-override"><code>    JFrame frame = new JFrame(&quot;FrameDemo&quot;);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   
      JLabel emptyLabel = new JLabel(&quot;&quot;);
      emptyLabel.setPreferredSize(new Dimension(175, 100));
      frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
   
      //Display the window.
      frame.pack();
      frame.setVisible(true);
  </code></pre>