JDK-6985776 : HW Choice is drawn incorrectly if there is JInternalFrame in the GlassPane
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: other
  • CPU: unknown
  • Submitted: 2010-09-17
  • Updated: 2011-01-19
  • Resolved: 2010-09-21
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 7
7Resolved
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b104)
Java HotSpot(TM) 64-Bit Server VM (build 19.0-b05, mixed mode)

also reproducible on 6u21

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows 7 Ultimate

A DESCRIPTION OF THE PROBLEM:

Running next code snippet you will see that Choice is not fully drawn. 
Screenshot is attached.

import java.awt.BorderLayout;
import java.awt.Choice;
import java.awt.Container;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
public class Mixing_ChoiceGlassPane {
    protected final static String[] petStrings = {"Bird", "Cat", "Dog", "Rabbit", "Pig"};

    public static void main(String[] args) {
        JFrame frame = new JFrame("Glass Pane children test");
        frame.setLayout(null);

        Container contentPane = frame.getContentPane();
        contentPane.setLayout(new BorderLayout());

        Choice c = new Choice();
        for (int i = 0; i < petStrings.length; i++) {
            c.add(petStrings[i]);
        }
        contentPane.add(c);

        Container glassPane = (Container) frame.getRootPane().getGlassPane();
        glassPane.setVisible(true);
        glassPane.setLayout(null);

        JInternalFrame internalFrame = new JInternalFrame("Internal Frame", true);
        internalFrame.setBounds(50, 0, 200, 100);
        internalFrame.setVisible(true);
        glassPane.add(internalFrame);

        frame.setSize(400, 400);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}
Failed test:
AWT_Mixing/Automated/GlassPaneOverlapping/JGlassPaneInternalFrameOverlapping.java jtreg

Comments
EVALUATION The mixing feature relies on additional support from the JDesktopPane. In order to get a JIF behave correctly, please put it into the DesktopPane rather than into a GlassPane. See CR 6986333 for details.
21-09-2010

EVALUATION Reproducible on Windows Vista with jdk 6u18.
21-09-2010