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

REGRESSION: JDialog shows painting artifacts on first showing

XMLWordPrintable

    • b32
    • 6
    • b62
    • x86
    • windows_nt

      Compile and run the test case below. It shows a JFrame and then a JDialog. At the top and left of the JDialog, after it first appears, there are painting artifacts. The top row and left column of pixels aren't painted and the dialog shows colors from the desktop. This dissapears after forcing a repaint (such as by obscuring and then unobscuring the window). Attached, as artifacts.bmp, is a screen shot of the problem, which also shows the dialogs in question magnified to show the artifacts better.

      Note: I believe this was introduced with the gray rect fix.

      Source code for GR.java
      ----
      import javax.swing.*;
      import javax.swing.event.*;
      import java.awt.*;
      import java.awt.event.*;

      public class GR extends JFrame {

          public GR() {
              super("GR");
          }
          
          private void showLogDialog() {
              JDialog d = new JDialog(this);
              d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
              d.getContentPane().setBackground(Color.BLACK);
              d.setSize(100, 100);
              d.setVisible(true);
          }
          
          public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                  public void run() {
                      GR test = new GR();
                      test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                      test.setSize(300, 300);
                      test.setLocationRelativeTo(null);
                      test.setVisible(true);
                      test.showLogDialog();
                  }
              });
          }
      }
      ###@###.### 2005-04-14 16:32:29 GMT

            svioletsunw Scott Violet (Inactive)
            shickeysunw Shannon Hickey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: