Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jcombobox - drop down sheet size

I want to control the size of the sheet that opens down when I press the down arrow button in JComboBox, I want it to display much more options Is that possible ?

like image 742
Bick Avatar asked Apr 05 '11 12:04

Bick


People also ask

What is the difference between JComboBox and JList box give one method of each of them?

A JComboBox is a component that displays a drop-down list and gives users options that we can select one and only one item at a time whereas a JList shows multiple items (rows) to the user and also gives an option to let the user select multiple items.

Which is the superclass for JComboBox?

JComboBox inherits JComponent class .

How do I make JComboBox not editable?

u can make ur jcombobox uneditable by calling its setEnabled(false). A JComboBox is unEditable by default. You can make it editable with the setEditable(boolean) command. If you are talking about enabled or disabled you can set that by the setEnabled(boolean) method.

Which event gets generated when you select an item from a JComboBox?

This action listener gets the newly selected item from the combo box, uses it to compute the name of an image file, and updates a label to display the image. The combo box fires an action event when the user selects an item from the combo box's menu.


1 Answers

use setMaximumRowCount() to display as many rows as you want in the popup.

like image 118
Manoj Avatar answered Sep 28 '22 08:09

Manoj