void () { if (comboBox.isEditable() && editor != null) { Rectangle er = rectangleForCurrentValue(); Dimension eps = editor.getPreferredSize(); if (eps.height < er.height) { int delta = (er.height - eps.height) / 2; er.y += delta; } er.height = eps.height; editor.setBounds(er); } }