-
Enhancement
-
Resolution: Won't Fix
-
P5
-
1.1.5, 1.2.0, 1.3.1, 1.4.0, 1.4.1, 1.4.2, 6
-
generic, x86
-
generic, linux, windows_95, windows_98, windows_2000, windows_xp
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)
======================================================================
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)
======================================================================
- duplicates
-
JDK-4177322 JComboBox's popup menu is always the same width as the JComboBox
-
- Closed
-
-
JDK-4880218 JComboBox's popup menu should be able to have a different width as the JComboBox
-
- Closed
-
-
JDK-6257236 Bug 4177322 should be re-opened (JComboBox popup width)
-
- Closed
-