ComboBox: no longer ignore JComboBox.prototypeDisplayValue when computing popup width (issue #80)

This commit is contained in:
Karl Tauber
2020-03-31 18:53:55 +02:00
parent 97d5792341
commit d094709dc8
6 changed files with 7 additions and 14 deletions

View File

@@ -480,13 +480,8 @@ public class FlatComboBoxUI
@Override
protected Rectangle computePopupBounds( int px, int py, int pw, int ph ) {
// get maximum display size of all items, ignoring prototype value
Object prototype = comboBox.getPrototypeDisplayValue();
if( prototype != null )
comboBox.setPrototypeDisplayValue( null );
// get maximum display size of all items
Dimension displaySize = getDisplaySize();
if( prototype != null )
comboBox.setPrototypeDisplayValue( prototype );
// make popup wider if necessary
if( displaySize.width > pw ) {