ListCellRenderer renderer = cb.getRenderer();
int numOfcomponents = model.getSize();
for (int i = 0; i < numOfcomponents; i++) {
Object value = model.getItemAt(i);
Component cmp = renderer.getListCellRendererComponent(cb, value, i, model.getSelectedIndex() == i);
height = Math.max(height, cmp.getPreferredSize().getHeight());
width = Math.max(width, cmp.getPreferredSize().getWidth());
}
if (comboImage != null) {
height = Math.max(height, comboImage.getHeight());
width += comboImage.getWidth();
} else {