Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Swing: How to make the JComboxBox drop down list taller?

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.

like image 940
NoozNooz42 Avatar asked Jun 11 '10 04:06

NoozNooz42


1 Answers

You are looking for the setMaximumRowCount method.

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

like image 185
dbyrne Avatar answered Nov 14 '22 23:11

dbyrne