ComboBox represents a combination of a list and a button. Normally, only the selected item is visible. Clicking on the button makes the entire list visible in a (usually) drop-down format, from which an item can be selected. The
ComboBox class extends
List, and the flexible rendering model of a list is applicable to it. A combo box is good for optimum use of screen real estate, because only one item of the underlying list needs to be drawn on the screen, except when a selection is being made.
ComboBox has four constructors which are just like those of
List. Whenever we want to instantiate a combo box, we first need to define, as an array or a vector, the set of items that will form the list for the combo box ...