JDK-6768332 : PIT : Internal frame can be seen below the Canvas
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u12
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-11-06
  • Updated: 2011-01-19
  • Resolved: 2009-01-30
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
6u12 b02Fixed 7Fixed
Related Reports
Relates :  
Relates :  
Description
I have a JFrame which contains desktopPane. The DesktopPane contains two internal frame, which intern contains AWT Canvas. When i move the one internal frame to another , the internal frame goes behind the other internalframe canvas.  This is not seen in metal look and feel, but it is seen very clear if i run the testcase either in windows , nimbus & GTK LookAndFeel.   I have attached the screen shot & testcase. 

Step to reproduce:-
------------------
1) Run the attached testcase in any look and feel ( windows, nimbus & GTKLookAndFeel) -Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel  for windows laf
 -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel for nimbus
2) When the gui is visible, click on the red internal frame, observe that portion of the internal frame is hidden with in another canvas. If you see the same then the bug is reproduced. 
3) Move one internal frame with in another internal frame, observe that the top internal frame is gets hidden the below internal frame's canvas.

I tested this in 6u12 b01 pit build.

Comments
EVALUATION We can't use the direct instanceof approach since we don't want to introduce a dependency between the AWT and Swing. To solve the issue we're going to introduce a new private boolean member of the Component class named isOpaqueForMixing. This member will be accessible thru the sun.awt.AWTAccessor.getComponentAccessor() interface. The JInternalFrame will set this field to true in its constructor.
14-11-2008

EVALUATION The Nimbus L&F (as well as a number of other L&Fs) turn the JInternalFrame's (and probably some other components) to be non-opaque in order to be able to draw the rounded corners. This breaks the HW/LW Mixing code since the code considers these components being transparent. The fix is similar to the one for 6768307: the isOpaque() condition should read as: (comp.isOpaque() || comp instanceof JPopupMenu || comp instanceof JInternalFrame) This should fix the most common cases.
07-11-2008