JDK-6683775 : Painting artifacts is seen when panel is made setOpaque(false) for a translucent window
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-04-03
  • Updated: 2011-01-19
  • Resolved: 2009-05-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u14 b02Fixed 7Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
I have a frame , which is having a jpanel in the north & jpanel is having a button . In the center of the frame i have added a Jscrollpane which holds a textarea. I called panel.setOpaque(false) & set the frame to become translucent by calling  com.sun.awt.AWTUtilities.setWindowOpaque(frame, false); , when i call this method i can see two  button . I have attached screen shot of the same. When i comment the  com.sun.awt.AWTUtilities.setWindowOpaque(frame, false); line , Every thing works as expected. 

Step to reproduce:-
----------------------
1) Run the attached testcase.
2) If you see two button to the north of the frame , then the bug is reproduced.
Or see screen shot. If the gui & screen is seen then the bug is reproduce.


I run this program on 6u10 b14 .

Comments
EVALUATION The idea of the fix is to paint through RepaintManager only if the paint() method is called by the Swing painting system (by RepaintManager itself or paintImmediately())
30-12-2008

EVALUATION This bug is reopened, we need to fix it the way that painting double-buffered components to an off-screen image not corrupt Swing double-buffer
30-12-2008

SUGGESTED FIX The panel containing the components should be: 1. non-opaque: JPanel.setOpaque(false); 2. non-double-buffered: JPanel.setDoubleBuffered(false); In this case everything works fine.
04-04-2008

EVALUATION This is because making the components non-opaque (using setOpaque(false)) is not sufficient. The panel should had been made non-double-buffered as well (using the setDoubleBuffered(false)). Currently the Swing team is fixing this issue. Please refer to the CR 6668436 for more details. As soon as this CR is fixed the problem should disappear. Thus I'm closing this CR as a duplicate of the 6668436.
04-04-2008