Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
Name: ddT132432 Date: 01/02/2002 FULL PRODUCT VERSION : I tried all versions, including J2SE 1.4.0 beta 3 FULL OPERATING SYSTEM VERSION : any Windows ADDITIONAL OPERATING SYSTEMS : I have not checked A DESCRIPTION OF THE PROBLEM : Sometimes it is necessary for a JComboBox to be less wide than its preferred width. The current UI code limits the width of the popup list for the JComboBox to the width of the combo box, rather than the preferred width. Because of this, many of the list items cannot be distinguished from each other. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : 1. Build a narrow JComboBox 2. Click on it an look at the popup EXPECTED VERSUS ACTUAL BEHAVIOR : I would like to see the full data in the popup, not a clipped version of the data. This bug can be reproduced always. ---------- BEGIN SOURCE ---------- The show() method of BasicComboPopup contains the following code: Dimension popupSize = comboBox.getSize(); popupSize.setSize( popupSize.width, getPopupHeightForRowCount( comboBox.getMaximumRowCount() ) ); ---------- END SOURCE ---------- CUSTOMER WORKAROUND : This code, in BasicComboPopup.show(), fixes the problem: Dimension popupSize = comboBox.getSize(); Dimension prefSize = comboBox.getPreferredSize(); // mod popupSize.setSize( prefSize.width > popupSize.width // mod ? prefSize.width : popupSize.width // mod , getPopupHeightForRowCount(comboBox.getMaximumRowCount() ) ); I was able to deploy this fix using an elaborate patch involving subclassing WindowsComboBoxUI. (Review ID: 137845) ======================================================================
|