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