I'm aware of JList
and JComboBox
. I need the combo box drop down functionality with multiple selection functionality that JList
provides.
This is because the contents of the list are too huge to be displayed using a simple list. I also need to select multiple items, otherwise I would have been content with JComboBox
.
Any suggestions?
When using multi-select, it's better to use a list than a combo box. As GUI metaphors go, people expect a combo box to be single select, whereas lists can be either.
the contents of the list are too huge to be displayed using a simple list
Place the JList
in a JScrollPane
. You can call setVisibleRowCount(int) on the JList
to specify how many rows at a time should be shown.