Here's an example of a ComboBox component. It uses a TextField and a Button as it's main view. Clicking the button causes an InternalWindow to display just below the TextField. The InternalWindow has a ScrollGroup and a ListView of possible values.

Things to note:

We are using an InternalWindow to make sure the list displays over other views. See the code around the viewForMouse, mouseDown, and mouseDrag to see how we transfer the drags from the button to the listView at the right times.

There are large number of possible expansions to this compontent, a few are:

Allowing direct access to the ListView

Allowing for searching within the known values

Ability to restrict entry to only the known values