views:

53

answers:

1

How to make the "dropdown" (or "popup", I don't know how it's called) of a JComboBox taller on the screen?

By default, when I open my JComboBox I see, say, 7 out of 29 items, then I need to scroll.

What should I do so that I can see, say, 15 out of these 32 items? (or if the dropdown is, say, 150 pixels tall, how can I make it 300 pixels tall?)

I've read the Sun tutorial on JComboBox and the JavaDoc but I must have overlooked the method(s) to call.

+3  A: 

You are looking for the setMaximumRowCount method.

The JComboBox tutorial has some example code showing it in action.

dbyrne
@dbyrne: indeed, thanks a lot, works perfectly fine. I can only accept the answer in 6 minutes :)
NoozNooz42