padding in a ComboBox

hi !i need to set the padding inside a JComboBox (just like as in HTML Table's cellpadding).how can i accomplish that ?Thanks.
[155 byte] By [gkjogia] at [2007-11-27 5:09:06]
# 1
by using a cell renderer...DefaultListCellRenderer r = new DefaultListCellRenderer();r.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));combo.setRenderer(r);
bsampieria at 2007-7-12 10:28:41 > top of Java-index,Desktop,Core GUI APIs...
# 2
thanks for the reply. it works with .setEditable(false) boxes. It doesnt work with editable. How can i accomplish that ?gkjogiMessage was edited by: gkjogi
gkjogia at 2007-7-12 10:28:41 > top of Java-index,Desktop,Core GUI APIs...
# 3
for editable boxes, you'd have to get a reference to the editor's text field and similarly set the border to make it bigger.
bsampieria at 2007-7-12 10:28:41 > top of Java-index,Desktop,Core GUI APIs...
# 4

i did the following

ComboBoxEditor ced = combo.getEditor();

TextField temp = (TextField)ced.getComponent()

temp.setBorder(new EmptyBorder(5,5,5,5));

temp.setBackground(Color.GREEN);

The setting of color works, but the padding did not. My problem is that in ComboBox if first character is small case, its hard to make out.

gkjogia at 2007-7-12 10:28:41 > top of Java-index,Desktop,Core GUI APIs...
# 5
anyone have any ideas please ?
gkjogia at 2007-7-12 10:28:41 > top of Java-index,Desktop,Core GUI APIs...