JDK-4168483 : Mediumweight popup problem on Solaris
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.1,1.1.5,1.1.6,1.2.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS:
    generic,solaris_2.5,solaris_2.6,solaris_10,windows_nt generic,solaris_2.5,solaris_2.6,solaris_10,windows_nt
  • CPU: generic,x86,sparc
  • Submitted: 1998-08-22
  • Updated: 1999-01-15
  • Resolved: 1999-01-15
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.
Other Other
1.2.0Fixed 1.2.2 1.2.2Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
There is a problem with Mediumwieghts not popping up on Solaris in 1.2:

import java.awt.*;
import com.sun.java.swing.*;

public class Test extends JPanel {

    public Test() {
	setLayout(new BorderLayout());
	JComboBox screenCombo = new JComboBox();
	screenCombo.setLightWeightPopupEnabled(false);
	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


Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic FIXED IN: 1.2.2 1.2fcs swing2.0alpha INTEGRATED IN: 1.2.2 1.2fcs
14-06-2004

EVALUATION The problem seems to be that a focusLost event is delivered to the ComboBox when the mediumweight Panel is added. The ComboBox believes that this is the user tabbing out, and pops down the mediumweight menu accordingly. georges.saab@Eng 1998-09-18 OK, I have looked into fixing this, and it seems that it will take some time to understand why a focusLost event is being sent with isTemporary false in this case. However, a simple workaround is to check whether the combobox is using heavyweight menus in the focusLost method, and in that case NOT pop down the menu. This allows the menu to stay posted, at the cost of NOT having the right behavior when you tab out of the combobox (only when using mediumweights. This is better than the combobox not working at all! I'm going to apply the workaround, and open another (lower priority) bug to fix the bogus focusLost problem in AWT. Fixed in my WS, waiting for instructions on reintegration for JDK1.2. Note that this apparently happens on Windows as well as Solaris. georges.saab@Eng 1998-09-18
18-09-1998