JDK-4162493 : JComboBox does NOT pull down in Java2D Demo
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1998-07-31
  • Updated: 1998-08-22
  • Resolved: 1998-08-22
Related Reports
Duplicate :  
Relates :  
Description
The JComboBox in the Java2D demo does NOT pull down.  To reproduce run the Java2D demo :

/usr/local/java/jdk1.2/solaris/demo/jfc/Java2D

In the Global Controls panel appears the JComboBox; attempt to change to another item.  The list appears for a moment and then disappears.

java full version "JDK-1.2fcs-D"


Comments
EVALUATION This looks to be a JPopupMenu bug (possibly the AWT z-ordering bug). I think the JPopupMenu is trying to create a medium-weight popup and failing. I've seen this before it only happens on Solaris. It works fine on Wintel. tom.santos@eng 1998-08-07 I wonder whether they are using JFrame? There is the 'known' mediumweight popup bug on solaris, whose symptoms match this perfectly... georges.saab@Eng 1998-08-18 In Java2Demo.java : 296 public static void main(String args[]) { 298 JFrame frame = new JFrame("Java2D Demo"); In Java2DemoApplet.java : 20 public class Java2DemoApplet extends JApplet { brian.lichtenwalter@Eng 1998-08-18 =========================================================== This looks like it is a bug in medium weight popup menus. Two things need to happen here: 1. You can easily workaround this for Java2Demo with the following 2 diffs listed below. 2. We need a smaller testcase than Java2Demo to debug the problem with medium wieght popups. I suggest that the priority be lowered since there is an easy workaround, and would appreciate any help you can give in making a small test case. Diffs: --- Controls.java Fri Aug 21 14:39:38 1998 *************** *** 53,59 **** compositeCB = createCheckBox("AlphaComposite", false, 3); screenCombo = new JComboBox(); - screenCombo.setLightWeightPopupEnabled(false); screenCombo.setPreferredSize(new Dimension(120, 18)); screenCombo.setAlignmentX(LEFT_ALIGNMENT); screenCombo.setFont(font); --- 53,58 ---- *** /tmp/geta18612 Fri Aug 21 14:40:06 1998 --- TextureChooser.java Fri Aug 21 14:29:59 1998 *************** *** 99,105 **** return new GradientPaint(0,0,Color.white,80,0,Color.green); } ! public class TextureChooserCanvas extends Canvas implements MouseListener { public boolean clickedFrame; private int num; --- 99,105 ---- return new GradientPaint(0,0,Color.white,80,0,Color.green); } ! public class TextureChooserCanvas extends Component implements MouseListener { public boolean clickedFrame; private int num; georges.saab@Eng 1998-08-21 When making the suggested change all the JCheckboxes are framed in white, #4152007, and the JComboBox still does NOT pull down! There is another instance of JComboBox in the demo. In the 'Global Controls' panel there is a checkbox named 'ToolBar'. When the ToolBar checkbox is selected a panel with a toolbar & a JComboBox appears underneath the canvases. The JComboBox in this 'toolbar' panel does not pull down either! Instead a NPE exception is thrown. This exception appeared because J2DCanvas was made to be a Component like you suggested. Do I give up on JComboBox and use Coice instead? brian.lichtenwalter@Eng 1998-08-21 import java.awt.*; import com.sun.java.swing.*; public class test extends JPanel { public test() { setLayout(new BorderLayout()); JComboBox screenCombo = new JComboBox(); for (int i = 0; i < 20; i++) screenCombo.addItem(String.valueOf(i) + " Item"); add("North", screenCombo); JPanel jp = new JPanel(new GridLayout(0,3)); jp.add(new jpanel()); jp.add(new panel()); jp.add(new canvas()); add(jp); } public static void main(String s[]) { JFrame f = new JFrame("ComboBox test"); f.getContentPane().add("Center", new test()); f.pack(); f.setSize(new Dimension(300,300)); f.show(); } class jpanel extends JPanel { jpanel() { setBackground(Color.black); } } class panel extends Panel { panel() { setBackground(Color.blue); } } class canvas extends Canvas { canvas() { setBackground(Color.red); } } } // end test brian.lichtenwalter@Eng 1998-08-21
21-08-1998