Java Swing: How to make a JComboxBox dropdown list higher?

How to make a “pop-up menu” (or “pop-up window”, I don’t know what it's called) above on JComboBox?

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

What should I do to see, say, 15 of these 32 elements? (or if the dropdown is, say, 150 pixels high, how can I make it 300 pixels high?)

I read Sun's tutorial on JComboBox and JavaDoc, but I must have missed the method to call.

+6
java swing jcombobox
source share
1 answer

You are looking for the setMaximumRowCount method.

The JComboBox tutorial contains sample code showing it in action.

+3
source share

All Articles