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

PIT: Colors used in LGP,RGP change sporadically when the JPanel is repainted, LINEAR_RGB color space

XMLWordPrintable

    • 2d
    • b81
    • 6
    • b83
    • generic
    • generic
    • Verified

      I am extending JPanel and inside the paintComponent(), I am creating a LGP and RGP (only if they are null and not otherwise). I am filling half of a rectangle using LPG and other half using RGP. I have set a timer to repaint the JPanel every 30 ms.

      I am seeing the following:

      Some of the colors (say PINK) appear initially but later changes to a different color when the JPanel is repainted. In the given example, PINK changes to RED when the panel is repainted. This is seen/not seen in the following circumstances

      1. This does not happen when I use SRGB ColorSpaceType. Happens only in Linear_RGB

      2. This does not happen when I create the RGP, LGP everytime inside the paintComponent regardless of whether it is null or not.

      3. Only when I repaint the panel, the color changes.

      To reproduce, run the attached test and watch the PINK color. It changes to RED immediately after the panel is repainted.

      This is reproducible on all platforms with the Mustang b81 2D PIT build (2006-04-16.mustang)

            campbell Christopher Campbell (Inactive)
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: